sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[MIGRATION] Unable to build Xamarin Forms App after project migration

Open kvbhat opened this issue 9 years ago • 2 comments

Steps to reproduce

Reduced test case-

Program.cs:

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

project.json:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "platform": "AnyCPU",
    "preserveCompilationContext": true
  },
  "dependencies": { "Microsoft.NETCore.App": {
      "version": "1.0.0"
    },
    "Xamarin.Forms": "2.3.3.163-pre3"
  },
  "runtimes": {
    "win": {},
    "linux": {}
  },
 "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "portable-net45+wp80+win81+wpa81",
        "netstandard1.6"
      ]
    }
  }
}

run dotnet migrate run dotnet restore run dotnet build

Expected behavior

Build should be successful. With old dotnet build used to succeed but after migration to .csproj build fails when we have a Xamarin.Forms dependency.

Actual behavior

Build Error Reported-

/home/karthik/.nuget/packages/xamarin.forms/2.3.3.163-pre3/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(40,3): error MSB4062: The "Xamarin.Forms.Build.Tasks.FixedCreateCSharpManifestResourceName" task could not be loaded from the assembly /home/karthik/.nuget/packages/xamarin.forms/2.3.3.163-pre3/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/home/karthik/Desktop/dotnet-proj/sample/sample.csproj] /home/karthik/.nuget/packages/xamarin.forms/2.3.3.163-pre3/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(40,3): error MSB4062: Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/home/karthik/Desktop/dotnet-proj/sample/sample.csproj]

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0-preview1-005448)

Product Information: Version: 2.0.0-preview1-005448 Commit SHA-1 hash: f8c3c4a030

Runtime Environment: OS Name: ubuntu OS Version: 14.04 OS Platform: Linux RID: ubuntu.14.04-x64 Base Path: /home/karthik/Desktop/dotnet-dev-ubuntu-x64.latest/sdk/2.0.0-preview1-005448/

kvbhat avatar Mar 22 '17 05:03 kvbhat

(Related discussions happened in https://github.com/dotnet/cli/issues/5457)

dasMulli avatar Mar 22 '17 08:03 dasMulli

This CLI right now support .NET Core and a subset of full framework projects. We don't currently have a timeline for supporting Xamarim on the CLI, though it is definitely something we would like to do. However, I will close this issue for now.

livarcocc avatar Sep 25 '17 21:09 livarcocc