Error running ASP.NET Core Web API project

0

As you know MS released the visual studio version for OSX, my program runs in development, but when trying to run the project from the terminal without VS the following error appears:

  

/usr/local/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets (1111.5): error MSB3644: The reference assemblies for framework ".NETFramework, Version = v4.6.2" were not found To solve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/devOps92/Projects/SampleAPI/SampleAPI/SampleAPI.csproj]

I would appreciate if you can help me solve the problem or give me an idea of how to solve it.

Greetings and thank you very much.

    
asked by Alfredo Ramirez Ortega 28.05.2017 в 20:23
source

1 answer

1

Because of what the error says it would seem that your project uses the full framework or has some dependency of this type. The message reads: ".NETFramework, Version = v4.6.2" and that is the full framework and only works on windows.

To be cross platform and work on mac and linux you have to use .net core, or your "target framework" has to be net core app 1.x or net standard 1.x. And no .net framework 4.6.2.

As a first step, look at the properties of your / s project / s, in the application tab, to see which framework it points to / n.

    
answered by 30.05.2017 в 04:41