在C#中部署控制台应用程序的方法 -

在C#中部署控制台应用程序的方法 -

问题描述:

我有一个相对复杂的控制台应用程序,它依赖于几个dll。我想以最好的形式运送这个。我喜欢的方式是一个所有的依赖性嵌入在它的exe文件(不是那么大,约800K)。另一件事是,只是压缩Debug文件夹的内容,并使其可用,但我不知道是否一切都将可用这样(所有的依赖关系只能通过拉链调试文件夹解决)。

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?)

使用VisualStudio 2008部署使用C#编写的控制台应用程序有哪些可靠的实践?

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

p>如果你只是复制Foo.exe,dlls和Foo.exe.config文件,它可能是好的。看看在调试文件夹还有什么 - 你(可能)不想运送.pdb文件,或Foo.vshost.exe。还有别的事吗?如果您有任何标记为内容的项目已复制到输出文件夹,您也需要这些项目。

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.

可以 ilmerge 将所有依赖项放在一个exe文件中,但是我有点微不足道的方法 - 我会坚持用exe +依赖dll。

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.