0

I have installed both .NET Core and .NET Framework on my machine. Currently if I type dotnet --version it shows that I'm using .NET Core. How can I swap from .NET Core to .NET Framework in my powershell?

2 Answers 2

1

dotnet is part of .NET Core. It's the command line interface to .NET Core (only). There's no dotnet command for .NET Framework.

You can use the dotnet command to build applications for .NET Framework. Edit your csproj and change it to target .NET Framework (TargetFramework of net472, for example) and then use dotnet build. That is still using the dotnet from .NET Core but targetting and using assets from .NET Framework.

Another way to use .NET Framework is to use msbuild.exe directly. That always ends up using .NET Framework. But there's no dotnet equivalents (dotnet run).

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

3 Comments

If there is no CLI for .NET Framework how can I run my dll files or build a project?
AFAIK, for building, you can use msbuild.exe. If your build produces executibles, you can run them directly.
But what if I need to have dll files not exe. How can I run my project after publishing.
0

"dotnet" is .Net Core cli tool. You can read about this here

Comments

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.