Hi,

I have a client whose ASP.NET website intermittently doesn't display aspx pages. When the pages don't display they get a

"The type 'Global' is defined in an assembly that is not referenced..."

error message.

They've spoken to their web host who says that the problem is fixed and then from time to time it reoccurs.

I've noticed that the Global.asax is located in the root dir and contains the line:

<%@ Application Codebehind="Global.asax.cs" Inherits="Global" %>

But the Global.asax.cs file is located in the App_Code sub-directory.

Could the intermittent errors with loading the aspx pages be caused by the sub-directory not being listed within the location of the Global.asax.cs file? ie. so the line in the Global.asax would become:

<%@ Application Codebehind="~/App_Code/Global.asax.cs" Inherits="Global" %>

Any help or suggestions would be much appreciated!

Hi ,

What you are going to do is absolute wright.

before that pls check the global.asax.cs file whether the class has inherits with System.Web.HttpApplication class. more over check the class has been orgainzed with any name space. if it so then your asax page should implies like this <%@ Application Codebehind="~/App_Code/Global.asax.cs" Inherits="MyNameSpace.Global" %> Regards
razool

Regards
razool

Thanks razool. I have updated the Global.asax file and so far so good.

The Global class within the file global.asax.cs did inherit from System.Web.HttpApplication.

There doesn't sesem to be any namespace specified in the global.asax.cs. It only uses System classes and System.Configuration, System.Collections, System.ComponentModel, System.Web, System.Web.SessionState, System.Security.Principal, System.Data, System.Data.SqlClient classes.

Hi ,

What you are going to do is absolute wright.

before that pls check the global.asax.cs file whether the class has inherits with System.Web.HttpApplication class. more over check the class has been orgainzed with any name space. if it so then your asax page should implies like this

<%@ Application Codebehind="~/App_Code/Global.asax.cs" Inherits="MyNameSpace.Global" %>

Regards
razool

Regards
razool

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.