Brett Rowberry
Brett Rowberry

Reputation: 1050

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?

Upvotes: 4

Views: 1930

Answers (2)

Brett Rowberry
Brett Rowberry

Reputation: 1050

Right-click on the project, select Properties, select Build, in the ‘Other flags’ field enter --standalone.

Upvotes: 2

Tomas Petricek
Tomas Petricek

Reputation: 243096

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

Upvotes: 8

Related Questions