0

I don't have a Mac, I'm just trying to understand what happens when a person using a Mac wants to contribute to my .NET Core console application if its .csproj looks like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
    <RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win10-x64</RuntimeIdentifier>
  </PropertyGroup>
</Project>

Does it just work, except they can't test code within an #if NET452 directive and they can't build the net452 executable?

And what if my .csproj looks like this?

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net452</TargetFramework>
    <RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win10-x64</RuntimeIdentifier>
  </PropertyGroup>
</Project>
user1676558
  • 403
  • 1
  • 6
  • 18
  • 1
    .NET framework is meant for Windows. From my experience if you specify net452 in your project and run it on a Mac (I tried with Linux), the .NET SDK will use Mono (given that Mono is installed) –  Feb 14 '17 at 09:38
  • Sorry, I don't quite understand, are you talking about the developer's experience when opening the project or the end-user's when attempting to run it? I think I kind of understand the machine/platform-independence of CIL code. – user1676558 Feb 14 '17 at 15:02
  • What I gather it means is that it can compile and run with either .NET Core *or* .NET Framework but the same executable will not run on both. So you will be able to use `#if` directives. – borrrden Feb 15 '17 at 08:30
  • 1
    @user1676558 Your project is not "standalone" because the project file indicates that it relies on the runtime installed on the system (in this case net452 on win10-x64). So this project as-is won't run on a Mac. (no runtime specified for MacOS). If you add a Mac runtime (something like darwin) then the SDK will do its best to run it on the Mac using a net452 equivalent, which is basically Mono. –  Feb 16 '17 at 04:19

0 Answers0