error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.3\Microsoft\Portable\v5.0\Microsoft.Portable.CSharp.targets" was not found

.net-core, c#, visual-studio-2017

Solution

My solution to this was to convert the project to an Sdk-type csproj.

Check out this answer for tips on how to accomplish this.

In addition to this, I had issues with the analysers so I turned them off via the following csproj properties:

<Project>
  <PropertyGroup>
    <RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
    <RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
    <RunAnalyzers>false</RunAnalyzers>
  </PropertyGroup>
</Project>

Problem

I have .net core test project. When I build it in visual studio or use the TestManager it build without a problem. But when I execute the following command on the package manager console I get an error: dotnet test `C:\projects\moneyfox\Src\MoneyFox.DataAccess.Tests\MoneyFox.DataAccess.Tests.csproj` error: ``` error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.3\Microsoft\Portable\v5.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk ``` I checked the path, and there it really doesn't exist. But I'm kinda puzzled what to do with that, since it works when I build it over visual studio. Any suggestions?

Original source

Related problems