Link: https://support.microsoft.com/en-in/help/2028526/building-an-asp-net-project-in-visual-studio-results-in-compiler-error
When you create an ASP.NET project using Visual Studio, you may occasionally see an error message similar to the following:
Compiler error message: CS0433: the type "ASP.summary_common_controls_notes_ascx" exists in both "c: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 \ temporary ASP.NET \ Book_Details \ abc12345 \ def8910 \ App_Web_msftx123.dll" and " c: \ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 \ Temporary ASP.NET files \ Book_Details \ abc12345 \ def8910 \ App_Web_msfty456.dll '
Description: An error occurred while compiling the resource needed to service this request. Please review the following specific error details and modify your source code accordingly.
Source error: line 100: line 101:
New line of notes 102:
Line 103:
1450 line 104:
Summary.
Source file: d: \ http \ post \ publisher \ default.aspx Line: 102
Common scenarios where this error can occur are discussed below.
Scenario 1
Description. A common reason is that there are two assemblies in the same bin folder of a web application that contains two class definitions but have the same class name. This can happen if several Default.aspx files were compiled into one assembly. This usually happens when the main page (Default.master) and the default ASPX page (Default.aspx) both declare the _Default class. Solution: Change the class name of the main page (in most cases it is _Default) and rebuild the project. It is important to resolve any name conflict between classes.
Scenario 2
Description. The link path in Visual Studio is used to specify the folder path for the assembly links used by the project. It is possible that the path contains an assembly with the same class name. Perhaps several links have been added to one assembly (possibly with a different version or name), which can lead to a name conflict.
Solution: Delete the link to the old version. To do this, in Visual Studio, right-click your website and select "Links" in the properties.
Scenario 3
Description: By default, when compiling an ASP.NET web application, the compiled code is placed in the ASP.NET temporary files folder. By default, access rights are granted to the local ASP.NET account, which has the high-level permissions required to access the compiled code. It is possible that some changes have occurred in the default permissions that have led to version conflicts. Another possibility is that antivirus software can inadvertently block an assembly. Solution: Empty the ASP.NET temporary files folder from all contents.
Scenario 4
Description: If the batch attribute in the web.config file is set to True, this eliminates the delay caused by compilation, which is required when the file is first accessed. ASP.NET precompiles all uncompiled files in batch mode, which causes delays when compiling files for the first time. Disabling batch compilation can lead to masked compilation errors that may exist in the application but are not reported. However, more important for this problem, ASP.NET dynamically compiles individual .aspx / .ascx files into separate assemblies, rather than into a single assembly. Solution: set batch = false in the section in web.config. This should be considered a temporary solution, since setting batch = false in the compilation section has a significant impact on performance for application build time in Visual Studio.
Scenario 5
Description. Changing the web.config file for an ASP.NET application or changing the file in the bin folder (for example, adding, deleting, or renaming) will restart AppDomain. When this happens, all session state is lost, and cached items are removed from the cache when the website is restarted. It is possible that the problem is caused by an inconsistent state in the web application. Decision. Restart the application domain by touching (editing) the web.config file.
Scenario 6
Description: You can save the source code in the App_Code folder, and it will be automatically compiled at runtime. The resulting assembly is available for any other code in the web application. Therefore, the App_Code folder works the same as the Bin folder, except that you can store the source code in it instead of the compiled code. The class will be recompiled when the source file changes. If there is a conflict due to an outdated assembly, then forced recompilation can solve the problem. Decision. Touch the file in the Bin or App_Code folders to start a full recompilation.