15

I'm wondering what it means, exactly, when I have a .NET Core console app project that has its TargetFramework property (in the .csproj) set to a version of the full .NET Framework, e.g.

<TargetFramework>net461</TargetFramework>
  • If I compile this as a console application, will it use the .NET Core runtime, or the .NET Framework runtime?
  • If it uses the .NET Core runtime, can I encounter any incompatibilities between supported features in .NET Core and .NET Framework if I remain on the Windows platform?

1 Answer 1

11

If you have <TargetFramework>net461</TargetFramework>, then you don't have a .NET Core console app. You have a .NET Framework app that simply makes use of the newer csproj tweaks in the project file, and which can be easily built with the dotnet command-line tool.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, I suspected as much. Does this also mean that it will use the standard .NET runtime?
@Eyvind yes, it is 100% regular .NET Framework; if you want to target .NET Core, you need to use netcoreapp{version}; note that libraries can declare themselves agnostic by targeting netstandard{version}; what they actually end up running on depends on what the executable targets

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.