If this is the first time you are creating an app with the dotnet command, the command will print a verbose Welcome message, I suggest to read it carefully. Next time, when you will create a new app with the dotnet command the above message won’t be shown.

dotnet run does a lot of work in background and is kinda slow. If you just need to run the application, without modifying the code, there is a faster alternative:

1 dotnet run --no-build

just keep in mind that the above will skip the build phase. If you modify the code, use dotnet run.

An even faster way to start and run the app is to use the full path to the generated dll:

1 dotnet bin/Debug/netcoreapp2.1/HelloWorld.dll

As a side note, on my test machine, dotnet run takes about 2.8 seconds, dotnet run --no-build about 0.8 seconds and dotnet full_path_dll about 0.1 seconds. This is why I’ve presented you the above alternatives.

How about generating an executable from our F# code ? If you need an executable for macOS, Windows or Linux use one of the next commands:

1 dotnet publish -c release -r osx-x64

1 dotnet publish -c release -r win-x64

1 dotnet publish -c release -r linux-x64

If you target Raspberry Pi, use:

1 dotnet publish -c release -r linux-arm

The above will create a portable folder named publish that contains everything you need in order to run the executable.

For example, if I want to create a Windows executable from my macOS machine I will use:

1 dotnet publish -c release -r win-x64

The resulting publish folder is in the application folder in bin/release/netcoreapp2.1/win-x64. If I want to send the executable to someone that uses Windows, I will simply zip the publish folder and send it to my client.

Disclaimer:All data and information provided on this site is for informational purposes only. solarianprogrammer.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. solarianprogrammer.com does not collect any personal information about its visitors except that which they provide voluntarily when leaving comments. This information will never be disclosed to any third party for any purpose. Some of the links contained within this site have my referral id, which provides me with a small commission for each sale. Thank you for understanding.