I have a solution with multi-purpose csproj files:
<PropertyGroup> <TargetFrameworks>net45;netstandard1.6</TargetFrameworks> </PropertyGroup>
or
<PropertyGroup> <TargetFrameworks>net45;netcoreapp1.1</TargetFrameworks> </PropertyGroup>
I am trying to create a .NET Core part of this solution on Linux, but I cannot manage it. If I run
dotnet build
It builds all goals: netcoreapp1.1 , netstandard1.6 and net45 and fails on net45 because .NET Core does not provide the .NET 4.5 platform on Linux. I tried to solve this problem by specifying mono as the basis for building, but the solution is complex, and not all .NET 4.5 is supported in mono. However, this can help someone else avoid can't find .NETFramework v4.5 just starting:
FrameworkPathOverride=/usr/lib/mono/4.5/ dotnet restore FrameworkPathOverride=/usr/lib/mono/4.5/ dotnet build
When I run dotnet build /p:TargetFramework=netcoreapp1.1 , I get a lot of errors, I think, because projects with netstandard1.6 were not built.
If i pass
dotnet build /p:TargetFrameworks=netcoreapp1.1\;netstandard1.6
I get
MSBUILD : error MSB1006: Property is not valid. Switch: netstandard1.6
How can I pass netcoreapp1.1 and netstandard1.6 target frameworks simultaneously to msbuild from the command line?
I know that I can add an additional property and make conditional compilation depending on it, but I do not want to modify csproj to make this workaround.
source share