I tried different creation method, but I can't compile an android or iOs newly created project with Visual Studio Mac.
Latest OS X
Latest VS Mac (7.4.3 (build 10))
I always get the error (more log bellow)
The "XamlCTask" task could not be instantiated from "/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Build.Tasks.dll". Could not load file or assembly 'Xamarin.Forms.Build.Tasks' or one of its dependencies
Here is what I tried.
- Modify the
build/
orlib
to use netstandard or Xamarin.Mac. no luck. - Clean Project
- Delete
~/.nuget
- Delete package directory in project
Still no luck. I want to point out it's a newly created project, vanilla, it's quite a let down.
I copy the solution to my windows machine and try a build for android. First it fails because of the default target is 7.1, which seem to have a bug open for this issue for more than a year. https://bugzilla.xamarin.com/show_bug.cgi?id=50914
Then I updated it to use 8.0. it's working fine now.
Here a video of the process and failure https://youtu.be/yzHH4syrg8M
Here is the complete log
Target ResolveAssemblyReferences:
A TargetFramework profile exclusion list will be generated.
Target GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target _CoreXamlG:
Source: App.xaml
Language: C#
AssemblyName: test3
OutputFile obj/Debug/test3.App.xaml.g.cs
Target _CoreXamlG:
Source: test3Page.xaml
Language: C#
AssemblyName: test3
OutputFile obj/Debug/test3.test3Page.xaml.g.cs
Target CoreCompile:
/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/4.5/csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG /errorendlocation /preferreduilang:en-US /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/mscorlib.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/mscorlib.dll /reference:"/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/lib/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Core.dll" /reference:"/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/lib/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Platform.dll" /reference:"/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/lib/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Xaml.dll" /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/Microsoft.CSharp.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/Microsoft.VisualBasic.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Collections.Concurrent.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Collections.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.ComponentModel.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.ComponentModel.EventBasedAsync.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Core.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Diagnostics.Contracts.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Diagnostics.Debug.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Diagnostics.Tools.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Diagnostics.Tracing.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Dynamic.Runtime.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Globalization.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.IO.Compression.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.IO.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Linq.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Linq.Expressions.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Linq.Parallel.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Linq.Queryable.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Net.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Net.Http.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Net.NetworkInformation.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Net.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Net.Requests.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Numerics.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.ObjectModel.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Reflection.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Reflection.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Reflection.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Resources.ResourceManager.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.InteropServices.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.InteropServices.WindowsRuntime.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Numerics.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Serialization.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Serialization.Json.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Serialization.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Runtime.Serialization.Xml.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Security.Principal.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.ServiceModel.Web.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Text.Encoding.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Text.Encoding.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Text.RegularExpressions.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Threading.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Threading.Tasks.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Threading.Tasks.Parallel.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Windows.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.Linq.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.ReaderWriter.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.Serialization.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.XDocument.dll /reference:/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile111/System.Xml.XmlSerializer.dll /debug+ /debug:portable /optimize- /out:obj/Debug/test3.dll /resource:App.xaml,test3.App.xaml /resource:test3Page.xaml,test3.test3Page.xaml /target:library /utf8output App.xaml.cs test3Page.xaml.cs Properties/AssemblyInfo.cs "/var/folders/8p/x5dxkyrs4d78n96h43nldj7s2vmnqp/T/.NETPortable,Version=v4.5,Profile=Profile111.AssemblyAttributes.cs" obj/Debug/test3.App.xaml.g.cs obj/Debug/test3.test3Page.xaml.g.cs
Target XamlC:
/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.targets(103,3): error MSB4061: The "XamlCTask" task could not be instantiated from "/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Build.Tasks.dll". Could not load file or assembly 'Xamarin.Forms.Build.Tasks' or one of its dependencies
/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.targets(103,3): error MSB4060: The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
Done building target "XamlC" in project "test3.csproj" -- FAILED.
Done building project "test3.csproj" -- FAILED.
Build FAILED.
/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.targets(103,3): error MSB4061: The "XamlCTask" task could not be instantiated from "/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.Build.Tasks.dll". Could not load file or assembly 'Xamarin.Forms.Build.Tasks' or one of its dependencies
/private/var/workspace/fl/c#/test3/packages/Xamarin.Forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/Xamarin.Forms.targets(103,3): error MSB4060: The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
0 Warning(s)
2 Error(s)
The .csproj
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5E98F15F-62E3-4E94-8B99-AF6CB6DCDB6C}</ProjectGuid>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UseMSBuildEngine>true</UseMSBuildEngine>
<OutputType>Library</OutputType>
<RootNamespace>test3</RootNamespace>
<AssemblyName>test3</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile111</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="App.xaml" />
<EmbeddedResource Include="test3Page.xaml" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="test3Page.xaml.cs">
<DependentUpon>test3Page.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.5.0.121934\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets')" />
</Project>