The project in context is:
It has been in production for months without glitches until yesterday. I cleaned up the [Global.asax]
file (removed unused using statements, refactored, etc.), ran the solution and got the following error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'CloudTech.ATS.WebClient.Global'.
Source File: /global.asax Line: 1
Source Error: Line 1: <%@ Application CodeBehind="Global.asax.cs" Inherits="CloudTech.ATS.WebClient.Global" Language="C#" %>
Here is the Global.asax Markup:
<%@ Application CodeBehind="Global.asax.cs" Inherits="CloudTech.ATS.WebClient.Global" Language="C#" %>
Here is the Global.asax.cs Code (with internal code removed):
using System;
using System.Linq;
namespace CloudTech.ATS.WebClient
{
public class Global: System.Web.HttpApplication
{
}
}
After wrestling with this error for a while, I searched, restarted my computer, performed a full clean on the solution, force rebuilt but with no avail. Frustrated, I finally changed only the web application target to "Any CPU" and it worked. Unfortunately, "Any CPU" is not an option or a solution to the issue at hand. Changing it back to "x86" brings the same error back. This happened once and since then, no combination of target platform or debug/release configuration works anymore (same error).
Furthermore:
Lastly, the only change to my development systems has been windows updates (regular security updates) and I have tried the solution on systems without updates with the same results.
Any help would be appreciated.
The Application_Start and Application_End methods are special methods that do not represent HttpApplication events. ASP.NET calls them once for the lifetime of the application domain, not for each HttpApplication instance.
asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging). Save this answer.
They defined methods for a single class, application class. They are optional, but a web application has no more than one global. asax file.
Global. asax is the asp.net application file. It is an optional file that handles events raised by ASP.NET or by HttpModules. Mostly used for application and session start/end events and for global error handling.
Cleaning the solution and deleting the assemblies made no difference to subsequent builds. My solution was to just change the output path in project settings for the web app to Bin (rather than bin/x86/Debug).
Source:- "Could not load type [Namespace].Global" causing me grief
we had a similar issue here.
and what we did was just to close the IDE. and open it again, and then build, then run.
pretty frustrating and confusing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With