I am using Visual Studio 2015 and created a .NET Core console application. After compiling, I have my project DLL file in the debug folder. And if I want to run it on another computer, I have to install .NET on it and then write dotnet myApp.dll
in command window (CMD). But I need to run my application without any installations.
I have read that I must publish my application. I do it with the command dotnet publish -c Release
. Now in folder release I have a new folder, publish, with myApp.dll and other dll-files and folder runtimes for different systems. For example, in the Ubuntu.16.04-x64 folder I have file System.Security.Cryptography.Native.OpenSsl.so. But how can I run my application without any new installations of .NET or something else?
In . NET Core, it runs from the dll, so you have to just run the application by running the command prompt and using the command - dotnet run. Open your command prompt and go to that folder where your application persists.
NET works well on their Linux distributions. Support is provided by those distributions. You can still open issues at dotnet/core if you run into problems.
Follow the below steps to run your application:
Publish your application as a self contained application:
dotnet publish -c release -r ubuntu.16.04-x64 --self-contained
Copy the publish
folder to the Ubuntu machine
Open the Ubuntu machine terminal (CLI) and go to the project directory
Provide execute permissions:
chmod 777 ./appname
Execute the application
./appname
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With