1

We have a few console apps developed with .Net Framework. We used to run them on Windows, but now we'd like to try to use .Net Core for that. So far, this ridiculously simple way works fine (running Framework 4.5.1 app on Core 2.2):

  1. Copy the app with all its dependencies to Linux.

  2. Copy the runtimeconfig.json file from a Hello World .Net Core example to the app dir and rename it accordingly.

  3. Just run dotnet ./app.exe from that dir on Linux.

I find it really surprising that it works without rebuilding for the new target. But I suspect that there may be hidden problems or limitations of this approach. For one thing, obviously it won't run if the app uses something outside Core (say, WPF).

What are the exact conditions for running .Net Framework apps with .Net Core? Anything specific for Linux? Or for specific versions of Framework/Core?

3
  • I think you may take a look at .net framework compatibility mode: learn.microsoft.com/en-us/dotnet/core/porting/… Commented May 17, 2019 at 4:34
  • @mexanich, it's about porting. My question is about “just copying and running”. Commented May 17, 2019 at 6:01
  • 1
    You can use Mono Project to run .NET Framework based application on Linux. mono-project.com "Sponsored by Microsoft, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime." Commented Feb 13, 2021 at 13:09

1 Answer 1

2

The main things you'll run into is you need to have the dotnet runtime installed on any Linux installation you want to run the application on, else you have to build the binary directly for each of the supported platforms, which at the moment are Ubuntu, Debian, Fedora, Red Hat Enterprise Linux, OpenSUSE, Cent OS and SLES. In general, the only 2 commonly used .NET Framework things that don't work directly are Entity Framework, you need to use Entity Framework Core; and anything UI related. In general, CLI applications should work fine, but may require some tweaking.

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

1 Comment

It's exactly the “some tweaking” part I'm interested in. Having the runtime installed is not a problem. It's just in-house soft that will run on a few local servers.

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.