简体   繁体   English

部署包含dll项目和exe项目的Visual Studio解决方案

[英]Deployment of Visual Studio solution containing dll project and exe project

I have a Visual Studio 2010 solution that contains 3 projects: a dll project, an executable project, and the Installer project. 我有一个Visual Studio 2010解决方案,其中包含3个项目:dll项目,可执行项目和Installer项目。

I am working on the dll and the executable concurrently. 我正在同时处理dll和可执行文件。 The executable is simply a front end for the library. 可执行文件只是库的前端。 While developing the two in Visual Studio I simply added a reference to the dll project from within the executable and it works fine. 在Visual Studio中开发两者时,我只是从可执行文件中添加了对dll项目的引用,并且效果很好。

What I'm having trouble with is the deployment. 我遇到的麻烦是部署。 Ideally the dll would be compiled and installed in a subdirectory of the executable. 理想情况下,dll将被编译并安装在可执行文件的子目录中。 Using the "Visual Studio Installer - Setup Wizard" project template for my installer doesn't seem to be giving me the options I need. 为安装程序使用“ Visual Studio安装程序-安装向导”项目模板似乎并没有为我提供所需的选项。

Am I going about this wrong by developing my backend and frontend in different projects? 我通过在不同项目中开发后端和前端来解决这个问题吗? What steps should I take to deploy the compiled dll along with the executable? 我应该采取什么步骤来将编译的dll与可执行文件一起部署? I may be going about this all wrong, so please help me understand a better methodology if this seems backwards. 我可能会犯错,所以,如果这倒退了,请帮助我理解更好的方法。 For all the programming I learned in college, no one ever went over what I do when I actually want to deploy my software. 对于我在大学期间学到的所有程序设计,当我真正想要部署软件时,没有人会比我所做的事更复杂

This is what you need to do. 这是您需要做的。

On your Solution create new Project > Other project Types > Click Setup and Deployment 在您的解决方案上,创建新项目>其他项目类型>单击设置和部署

On The Application Folder > right click > Then Add your front end Application > Build. 在“应用程序文件夹”>右键单击>“然后添加前端应用程序”>“构建”。

Check this 检查一下

Regards 问候

Since the DLL project is explicitly referenced from the EXE project, it is automatically copied in the EXE's build folder (ie bin\\Debug or bin\\Release) and is considered part of EXE project's "primary output". 由于DLL项目是从EXE项目中明确引用的,因此它会自动复制到EXE的生成文件夹(即bin \\ Debug或bin \\ Release)中,并被视为EXE项目的“主要输出”的一部分。 As a consequence, you only need to reference the EXE from your setup project. 因此,您只需要从安装项目中引用EXE。

The installed DLL will be in the same folder as EXE. 安装的DLL将与EXE位于同一文件夹中。 Why would you want to install the DLL in a different folder on the user's machine if it is not there on the development machine? 如果开发计算机上没有DLL,为什么还要将其安装在用户计算机上的其他文件夹中? If you are loading it dynamically and using reflection, then don't reference it from EXE, but do reference it from the setup project, which then gives you the power to set whatever target folder you want. 如果要动态加载并使用反射,则不要从EXE引用它,而要从安装项目中引用它,这将使您可以设置所需的任何目标文件夹。

暂无
暂无

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

相关问题 从Visual Studio 2010解决方案中卸载.vdproj(Visual Studio部署项目) - Unload .vdproj (visual studio deployment project) from visual studio 2010 solution 在 Visual Studio 中重命名项目/解决方案 - Renaming project / solution in Visual studio Visual Studio dll作为依赖项目 - visual studio dll as a dependent project 多个项目Visual Studio解决方案不会调试一个项目DLL - Multiple project visual studio solution won't debug one project dll Visual Studio Solution(.sln) / C#:以另一个项目的 dll 作为参数启动一个项目 - Visual Studio Solution(.sln) / C#: Start a project with another project's dll as parameter 在Visual Studio C#解决方案中将DLL引用替换为Project refs以获取项目依赖性 - Replace DLL refs with Project refs for project dependencies in Visual Studio C# solution 如何在Visual Studio 2010安装和部署项目中包括第三方exe? - How to include third party exe in visual studio 2010 setup and deployment project? 如何在安装时在 visual studio 部署项目中添加包含可执行路径的注册表值 - How to add registry value containing executable path in visual studio deployment project at installation 在Visual Studio项目中添加Microsoft.Office参考时,使用exe部署哪个dll? - What dll to deploy with exe when Microsoft.Office reference is added in Visual Studio project? 如何在 Visual Studio 或其他构建工具的一个 C# 项目中生成 dll 和 exe 的混合体? - how to produce a mix of dll and exe in one C# project in visual studio or other build tools?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM