简体   繁体   中英

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.

I am working on the dll and the executable concurrently. 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.

What I'm having trouble with is the deployment. Ideally the dll would be compiled and installed in a subdirectory of the executable. Using the "Visual Studio Installer - Setup Wizard" project template for my installer doesn't seem to be giving me the options I need.

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? 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". As a consequence, you only need to reference the EXE from your setup project.

The installed DLL will be in the same folder as 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? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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