简体   繁体   English

使用Visual Studio 2010创建“最小部署程序包”

[英]Create a “minimum deployment package” with Visual Studio 2010

When I choose to "Rebuild Solution" in Visual Studio, the output in the binaries looks something similar to this: 当我选择在Visual Studio中“重建解决方案”时,二进制文件中的输出类似于以下内容:

MyProgram.exe
MyProgram.pdb
MyProgram.exe.config
MyProgram.vshosts.exe
MyProgram.vshosts.exe.config
MyProgram.vshosts.exe.manifest
log4net.dll
log4net.xml
SomeOtherLibary.dll
AnotherLibrary.dll

Which seems an awful lot of stuff for a Release, as all you really need to run the program is the exe , config and the dll s of the libraries. 对于发行版,这似乎有很多东西,因为运行程序所需的全部是库的execonfigdll

How could I go about building a "minimum deployment package", that really only contains the bare minimum that is need to run the program on another machine (of course assuming it has .NET installed)? 我如何才能构建一个“最小部署程序包”,它实际上仅包含在另一台计算机上运行程序所需的最低要求(当然,假定已安装.NET)?

I would create an installer . 我将创建一个安装程序 It's pretty simple to do and it ensures you have all the right files bundled in a single .msi, with the extra advantages of resolving dependencies on .NET, registry keys, file associations and anything else you might need. 这非常简单,并且可以确保将所有正确的文件捆绑在一个.msi中,并具有解决对.NET,注册表项,文件关联以及您可能需要的其他任何内容的依赖的额外优点。

If you really want to create package without an installer, you'll need to manually specify the files you want to include. 如果您确实想在没有安装程序的情况下创建软件包,则需要手动指定要包括的文件。 We do this for some projects here and we have our build server run a Nant build that simply packages files into a .zip file. 我们在这里为某些项目执行此操作,并且我们的构建服务器运行Nant构建,该构建会将文件简单打包为.zip文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM