Dervin Thunk
Dervin Thunk

Reputation: 20119

Ways to deploying console applications in C#

I have a relatively complex console application which relies on several dlls. I would like to "ship" this in the best form. My preferred way would be an exe file with all dependencies embedded in it (not that big, about 800K). Another thing would be to just zip the contents of the "Debug" folder and make that available, but I'm not sure if everything will be available like that (will all dependencies be resolved just by zipping the debug folder?)

What reliable practices exist for deploying console apps written in C# using VisualStudio 2008?

Upvotes: 43

Views: 57821

Answers (5)

alrightyy
alrightyy

Reputation: 113

You can use wix installers to bundle it. For console application, exe + dependicies DLLs + nuget DLLs , zipping them is enough.

Upvotes: 0

brien
brien

Reputation: 4440

You should look into setup projects in Visual Studio. They let you set up dependencies and include the DLLs you need. The end result is a setup.exe and an MSI installer.

Here's a walkthrough that should help.

Upvotes: 13

Cheeso
Cheeso

Reputation: 192467

OR you could use a self-extracting ZIP file. Package all the normal files up - .exe, .dll, .config, and anything else - into a zip file. Extract into a temp directory and set the run-on-extract program to be the actual console exe.

Upvotes: 2

HasaniH
HasaniH

Reputation: 8402

Create a setup project in VS08 and add the primary output of the console app project to it, this resolves the dependencies and packages them in a .msi

Upvotes: 0

Jon Skeet
Jon Skeet

Reputation: 1500525

If you just copy the Foo.exe, dlls and Foo.exe.config files, it's likely to be okay. Have a look at what else is in the debug folder though - you (probably) don't want to ship the .pdb files, or Foo.vshost.exe. Is there anything else? If you've got any items marked as Content which are copied to the output folder, you'll need those too.

You could use ilmerge to put all the dependencies into one exe file, but I'm somewhat leery of that approach - I'd stick with exe + dependency dlls.

Upvotes: 43

Related Questions