在需要特定dll的Visual Studio中创建安装/设置文件

问题描述:

我在Visual Studio 2010 Express版中开发了一个程序.我想为该程序创建一个安装/设置文件. Express版仅允许我创建一键安装程序".该程序需要一个dll文件,该dll文件必须与该程序的exe文件位于同一目录中.但是,我无法导入dll文件作为参考,因为它会产生错误.因此,一键安装文件无法正确安装程序.

I developed a program in Visual Studio 2010 Express edition. I want to create an installation/setup file for the program. The Express edition only allows me to create a "One Click Installer". The program requires a dll file that must be in the same directory as the exe file of the program to work. However, I am unable to import the dll file as a reference as it generates an error. Therefore, the One Click installation file does not install the program correctly.

是否可以在安装过程中强制一键式"安装程序将该文件复制到安装目录?如果没有,我还需要为我的项目创建一个安装/设置文件的其他选项吗?

Is it possible to force the One click installer to copy that file to the installation directory during the installation process? If not, what other options do I have to create an installation/setup file for my project?

谢谢

它称为ClickOnce.项目+添加现有项,然后选择该DLL.这会将其添加到您的项目中.选择它,然后在属性"窗口中查找.应将构建操作"设置为内容",以使ClickOnce发布它.复制到输出目录应设置为如果更新则复制",以确保将DLL复制到您的生成输出目录.您以前手工做过的事情.

It is called ClickOnce. Project + Add Existing Item and select that DLL. That adds it to your project. Select it and look in the Properties window. Build Action should be set to "Content", that makes ClickOnce publish it. Copy to Output Directory should be set to "Copy if newer", that ensures that the DLL is copied to your build output directory. What you did by hand previously.