Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build with msbuild.sdk.extras on dotnet build #161

Open
AArnott opened this issue May 5, 2019 · 2 comments
Open

Can't build with msbuild.sdk.extras on dotnet build #161

AArnott opened this issue May 5, 2019 · 2 comments

Comments

@AArnott
Copy link
Collaborator

AArnott commented May 5, 2019

Now that we can target .NET Framework on Linux with dotnet build I decided to give it a go with vs-streamjsonrpc. But it fails to build with this error:

/home/andrew/.nuget/packages/msbuild.sdk.extras/2.0.24/Build/Workarounds.targets(27,5): error : If you are building projects that require targets from full MSBuild or MSBuildFrameworkToolsPath, you need to use desktop msbuild ('msbuild.exe') instead of 'dotnet build' or 'dotnet msbuild' [/home/andrew/git/vs-streamjsonrpc/src/StreamJsonRpc/StreamJsonRpc.csproj]

I don't understand why I'm hitting this. It seems to be unique to building the portable-net45+win8+wpa81 target framework, which is the only reason I need the MSBuild.Sdk.Extras in the first place.

Thoughts?

Repro steps:

git clone https://github.com/AArnott/vs-streamjsonrpc.git
cd vs-streamjsonrpc\src
git checkout 2bf2c7a985a1e323d96d8f14c1c506529c7dc278
dotnet build
@dasMulli
Copy link

dasMulli commented May 5, 2019

The reference assemblies packages don't have reference assemblies for PCLs though, just .NET Framework.

There is a _SdkIgnoreMSBuildCoreWarning you could try. And maybe you could get the PCL to compile against a reference assembly by playing around with conditional AssetTargetFallback values, but that's probably (even more) dangerous waters..

@AArnott
Copy link
Collaborator Author

AArnott commented May 5, 2019

The reference assemblies packages don't have reference assemblies for PCLs though, just .NET Framework.

Thanks, @dasMulli. That makes sense as to why the build would fail, but the error message doesn't particularly help me discover that. Perhaps at least that can be improved.
For now, I've successfully merged a similar change to our v2.0 version of vs-streamjsonrpc. Our v2.0 version had already dropped PCL support, so that made it easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants