Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I deploy a C# console application as a single exe? [duplicate]

I have searched for this and there are a number of previous answers but all seem overly complex.

I'm new to C# and Windows development in general (previous Mac developer).

I have written a simple console application in C# using Visual Studio Community edition. My application uses two third party libraries (CommandLineParser and json.NET) added to my project with NuGet from within VS.

All I want to do is build my project as a standalone .exe file that can be simply run from a command prompt without having to worry about the end user having to install lots of DLLs (something that I'm not used to dealing with as a new Windows user). I understand that the end user would need to have the .NET framework installed. Is there an idiot-proof guide to building a single .exe file in my use case?

I can't help but think that this must be a very common problem.

Thanks.

like image 236
Garry Pettet Avatar asked Nov 11 '16 10:11

Garry Pettet


People also ask

How do you deploy a C++ project?

On the menu bar, choose File > New > Project to open the New Project dialog box. In the New Project dialog tree view control, select Installed > Templates > Visual C++ > MFC. In the center pane, select the MFC Application template.

How do I deploy a web application locally?

The easiest way is to use the admin console. Click Applications on the left, then click Deploy . You will need to select the app from your local machine to be deployed. Most other settings can be left as default, but make sure there is a server in the target list.


1 Answers

Alternatively if you want to run adhoc test to see that it really works and get it done relatively fast you can try using ILMerge-GUI

I have previously struggled to use ILMerge by itself. With the GUI, it was much faster for me to verify that I can get everything working.

like image 110
CJC Avatar answered Sep 21 '22 10:09

CJC