How to manage the generated DLL during Visual Studio Compilation

Source: Internet
Author: User

When developing with Visual Studio, the source code of other class libraries will be referenced. Generally, there are two methods to reference a class library.

1. Directly reference the project.

2. reference the DLL generated by the project.

If there are two projects, projecta and projectb. Projecta references projectb.

 

Question 1:

In the second method, project TB dll will be taken to the bin (default) folder of Project ta during project compilation.

Now, I want to put the DLL tested by the Project TB project into a folder DLL under the bin folder of the Project TA project, in this case, you only need to add the command: Move/y $ (targetdir) \ * to the command line for generating event = in projecta project properties )\*. DLL $ (targetdir) \ DLL

The taigetdir project path is in Bin/debug. You can click Edit to generate a post-generated event to generate the event.

In this way, we can test the compiled DLL to the desired folder, but the disadvantage of this compilation is to re-compile the project.

 

Question 2:

When we open two projects (projecta and projectb) in debug mode, projecta has referenced projectb. When we compile projecta, the system will prompt that the DLL is referenced by other processes (the project is open ).

Someone on the Internet also said that the compilation of Visual Studio is bypassed by spoofing. The procedure is as follows:

Create a folder named $ (configuration) under the DLL generation path in the project TB project)

Add the command xcopy/y $ (projectdir) bin \ $ (configuration) "$ (projectdir) bin \ % 2 $ % 2 (configuration )\"

Copy the DLL generated from the bin to the $ (configuration) folder.

So we can change the DLL generated by the original projecta reference projectb to the DLL generated in the $ (configuration) folder.

At this time, the Reference Path in projecta is still original. Deceiving our glasses.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.