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

Building only dotnet core packages / available rids on MacOS / liunx #1586

Closed
niemyjski opened this issue Feb 17, 2017 · 2 comments
Closed

Comments

@niemyjski
Copy link

So with the Foundatio project and our other projects (https://github.com/exceptionless/foundatio) we target .net core/standard as well full framework. What I'd like to happen is if you are on an operating system that doesn't support the full framework we only build the core/standard targets..

I know that we can do this partially with msbuild conditionals which I haven't yet fully looked into. But how do you do it if you have a project that only supports the full framework? I want the solution to build without error but I want it to completely skip a project of which the runtime is not (yet) supported.

@davkean
Copy link
Member

davkean commented Feb 20, 2017

There's not a way out-of-the-box to do what you are after, you can't conditionally build a project if you are calling MSBuild on the solution. What I've seen other projects do, is to:

  1. Have two solutions; one that represents the projects you build on Windows, and one that represents the projects you build cross-platform. This is what Roslyn does with CrossPlatform.sln and Roslyn.sln.

  2. Having a custom build script that simply calls MSBuild on the projects you want build cross-platform. You could do that in a script or call MSBuild task yourself, similar to: https://github.com/dotnet/roslyn-project-system/blob/master/build/build.proj#L46.

Alternatively, you could write a custom targets file that you import that overrides the Build target to do nothing for full framework projects when on a platform other than Windows.

@srivatsn
Copy link
Contributor

This is tracked by dotnet/sdk#826

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

3 participants