0
votes

I am setting up a new Xamarin development environment on a MacOS High Sierra 10.13.4

First I installed XCode, then Visual Studio for Mac, then Android Studio

I wanted to test a simple hello world on Xamarin Forms. So I just created a new solution with a blank Xamarin Forms app

When I try to build I get this error:

Error: The SDK 'Microsoft.NET.Sdk' specified could not be found. (FormsApp)

The strange thing is that when I go to Tools->SDK Manager SDK Locations->.Net Core it has a green checked sign saying SDK Found and I can see its path: /usr/local/share/dotnet/dotnet

If I create and try to run an ASP.Net I get this error:

Error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/xbuild/15.0/bin/Microsoft.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. (MSB4019) (MVCTest)

I am not able to run any template.

How can I fix this?

Thanks

1
Not seen this error before. Mono's msbuild should use the sdk resolver in the directory /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/ to find the .NET Core 2.0 sdk. The other error is for a non .NET Core ASP.NET project so it would not be using any .NET Core SDK components? If so possibly you could try reinstalling Mono since that seems to be causing the problem here. Also might be worth doing a diagnostic build from the command line: msbuild YourSolution.sln /v:diag > build.txt which might help diagnose thisMatt Ward
This generated a huge txt file so I will copy just the end of it:jose luis gonzalez clua
see next post pleasejose luis gonzalez clua
thanks for your helpjose luis gonzalez clua

1 Answers

0
votes

Figured out!

My anti-virus was deleting the mono file csc.exe every time I tried to install!

So if you are having the same error try turning off any anti-virus.