Recently, because the project deployment needs to add the webdeploymentproject in the solution, but the circular reference is always reported when the project is generated. Check the relevant information and prompt to disable the web. the batch processing switch in config <compilation batch = "true"/> does not seem to work. according to "official", Asp.net compiles controls and pages in different folders into one Program Centralized issues. Later, there was no way. I had to move all the user controls to a directory. After two days and two nights, the changes were completed, but the results were still unsatisfactory.
In desperation, several user controls were opened and suddenly found that the control name could not match the class name in the background. The problem is obvious. Our developers renamed the control after writing the control, but the operations in vs only set the Page name and backgroundCodeThe file name has been changed, and the class name in it has not been changed. In this case, if there is another such control, in addition, if the name is exactly the same as the original class name, there will be a conflict between the two class names. We do have this situation now, however, this cannot be found when a website is generated. However, when a webdeploymentproject is generated, it is detected. But why is there no specific error message? It simply prompts a "Do Not Allow loop reference" error, at one time, I was very confused. The background found in the configuration manager that the mo compilation output information was set to the "min" mode, in this way, the information displayed on the output console is very limited. You only need to change the output mode to "detail" or "diagnosis" mode to find the problem, it will report that the inheritance class names of two controls are repeated, so that you can easily locate the fault point.
In general, this problem is caused by non-standard encoding. Based on this, it is necessary to emphasize some basic encoding specifications.
1. The control name must correspond to the class name. When modifying the control name, the class name must also be modified.
2. Add namespaces to controls and page background classes to reduce error opportunities.
3. when dragging a user control, you do not need to use a namespace such as uc1 or UC2 with a uniform name. 4. when two controls need to reuse the background class code, they need to separate the background class, use inherits to specify the inherited class name without using the attribute name of codefile. if not, problems may occur.
In addition, it should be noted that when using the webdeploymentproject, it has strict requirements on the Code. Any code with a warning compilation error cannot be generated successfully. The advantage of using webdeploymentproject is also obvious. It can store the page pre-compilation directly, so that the Asp.net runtime environment does not need to be pre-compiled during the first running of the program, the startup speed will increase a lot.