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
- Exclude WPF.targets when building on non-Windows OS Fixes onovotny/MSBuildSdkExtras#31 — committed to zgramana/MSBuildSdkExtras by zgramana 6 years ago
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>forWpf.targetsbehind an OS check condition.Ah, I see. I was under the impression that
dotnet msbuildwould run the normal MSBuild anyway.It does work with a normal MSBuild shipped with VS. Thanks!
@lextm In your case,
dotnet testactually rebuilds things, and that’s a problem. Sdk Extras requires usingmsbuild. Can you try adding--no-buildas a parameter todotnet test? It should prevent it from rebuilding?