简体   繁体   中英

ASP.NET WebForms

I'm a beginner in ASP.Net WebForms.I have a problem when I run my application.

This is my compilation error:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\\Users\\DELL\\AppData\\Local\\Temp\\Temporary ASP.NET Files\\root\\7b316ac0\\74a3eae4\\App_global.asax.nlr3yglh.dll' and 'c:\\Users\\DELL\\AppData\\Local\\Temp\\Temporary ASP.NET Files\\root\\7b316ac0\\74a3eae4\\assembly\\dl3\\c7339aea\\6d83affb_aa85d001\\App_global.asax.DLL'

Source Error:

Line 165:        }
Line 166:        
Line 167:        protected ASP.global_asax ApplicationInstance {
Line 168:            get {
Line 169:                return ((ASP.global_asax)(this.Context.ApplicationInstance));

Source File: c:\\Users\\DELL\\AppData\\Local\\Temp\\Temporary ASP.NET Files\\root\\7b316ac0\\74a3eae4\\App_Web_userlogin.ascx.cdcab7d2.wpz3jgra.0.cs Line: 167

I think you shouldn't use the option of building assemblies for every page. You should build into a single assembly. If you use assemblies per page, when you deploy you should delete all assemblies in the bin, since they are previous versions and they have unique ids in the name, so they don't get overwritten.

In your case, clean your bin and then build. But I would suggest a single library for a full code-behind update, rather then specific code-behind updates for specific pages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM