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.