Sometimes compiling a large C # project file may cause a very headache: you cannot copy XXX to the xxx directory because it conflicts with dependencies. However, after checking, you will find that there are no compilation errors.
The solution to this problem is as follows:
1: Search for the dynamically generated files in the folder where the project is located, and kill all the files!
In the search box, enter :*. EXE ,*. DLL ,*. PDB ,*. SCC ,*. XML ,*. resources ,*. projdata (Note: Do not delete static referenced files)
Then re-compile. This method usually works very well.
2: This warning or error may occur when the components reference each other very complicated due to the chaotic design at the beginning.
Assume that one project is referenced by three different projects at the same time, one of the three is referenced by one of the three, and the other is referenced by the other ...... Well, I'm dizzy, and vs won't be dizzy. It will produce these in order of production.ProgramSet. In this way, a version number is generated first, and another version number is generated later. The final result is that you need to run different versions of the same assembly, but obviously, one Assembly only needs one, so the problem arises: VS wants to replace the advanced DLL, but this DLL is required for the production of another project ...... Only warning is needed. If an error is generated in severe cases, the project cannot be compiled!
To solve this problem, let's talk about the version control of the assembly ...... Now, I understand. The simplest solution to this problem is to find the project assemblyinfo. in the CS file, replace the [Assembly: assemblyversion ("1. 0. * ")] change to your own version number, for example, [Assembly: assemblyversion (" 1.0.3 ")]. In this way, the version of the Assembly will not be adjusted by yourself, but will be determined based on the version number you specified. No matter how many times you compile the project, the version number is always the number you have defined, and the final result is that the error shown in the title of this article will not appear.
3: Find the class library that cannot be copied as prompted, search for all the class libraries in the current working directory, and delete all the libraries. Then, change the reference path of each project to keep the current working directory, and delete other items. This method is also valid in general.
4: If none of the above three methods can solve your problem, we will be able to find a trick (this trick is highly toxic and should be used with caution )! Find the class library name that cannot be copied, search for all the DLL files on the hard disk (to be backed up), and delete all the files. Then compile again. This problem has obviously been solved.