MSBuildSdkExtras: net452 compilation failed after upgrading from 1.1.0 to 1.2.x

https://ci.appveyor.com/project/lextm/sharpsnmplib/build/1.0.286

C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(41,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.4\15.0\Bin\Microsoft.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [C:\projects\sharpsnmplib\SharpSnmpLib\SharpSnmpLib.csproj]

This error happens for both 1.2.0 and 1.2.1. Switch back to 1.1.0 and then it works again.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

BTW, ran across this issue as well. Eventually tracked it down to a platform incompatibility (WPF on a Mac isn’t a thing). Sent the PR above to put the <Import> for Wpf.targets behind an OS check condition.

Ah, I see. I was under the impression that dotnet msbuild would run the normal MSBuild anyway.

It does work with a normal MSBuild shipped with VS. Thanks!

@lextm In your case, dotnet test actually rebuilds things, and that’s a problem. Sdk Extras requires using msbuild. Can you try adding --no-build as a parameter to dotnet test? It should prevent it from rebuilding?