-
Porting MSBuild Projects To XBuild
<NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' == 'Windows_NT'">"$(NuGetExe)"</NuGetCommand> <NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExe)"</NuGetCommand>
-
Cross Platform Builds on Windows and Mono with MSBuild
<Reference Include="Windows.Specific.dll" Condition=" '$(OS)' != 'Unix' "/> <Reference Include="NonWindows.Specific.dll" Condition=" '$(OS)' == 'Unix' "/>
MSBuilds
has:$(OS)
->OSX/Unix/Windows_NT
EDIT!!OSX
seem to have been removed recently: dotnet/msbuild#538xbuild
only has:$(OS)
->Unix/Windows_NT
, on Mac it also evaluates toUnix
[RFC] Detecting current OS in targets:
MSBuild sets the
$(OS)
property toOSX/Unix/Windows
at runtime, which can be used in targets to determine the current OS. But xbuild has been using$(OS)==Unix
on OSX and Linux, because of an old mono bug. And it continues to do so for compatibility reasons.