Open Shivaraj117 opened 5 years ago
This one works only with '$(OS)' != 'Windows_NT'.. Why doesnt this build on windows?
I'd be interested to know why you're trying to compile for a different target framework depending on the operating system. I wouldn't normally recommend this.
Can you provide more information on how this is failing? If you can provide a binlog that would help.
Finally, if you really do want to set the target framework based on the OS, I would suggest trying to do it with an entirely SDK-style project, like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework Condition=" '$(OS)' == 'Windows_NT' ">net461</TargetFramework>
</PropertyGroup>
</Project>
There is a scenario where we need to run the existing project(windows) on Linux. so i was trying this approach.