Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile .NET console app as single executable

I have a console app written in F# targeting .NET Framework 4.6.2. The artifacts of my build are MyApp.exe and FSharp.Core.dll. This page https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-options suggests that the —-standalone flag should allow me to produce a stand-alone MyApp.exe. How do I do that in Visual Studio (2017) or through some other means?

like image 947
Brett Rowberry Avatar asked Sep 29 '25 09:09

Brett Rowberry


1 Answers

In Visual Studio, you can right-click on the project, go to properties and specify --standalone in "Other flags". The following screenshot is from VS2015, but I think this looks the same in VS2017.

Also, if you are using both Debug and Release builds, you will need to specify this for both of them.

enter image description here

like image 147
Tomas Petricek Avatar answered Oct 02 '25 05:10

Tomas Petricek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!