Closed niemyjski closed 7 years ago
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:
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.
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.
This is tracked by https://github.com/dotnet/sdk/issues/826
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.