Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.HttpException Could not load type '[namespace].???'

Tags:

types

asp.net

web

This started as Could not load type 'Global' error. After I tried a few things and getting no where I deleted the Global.asax file and now the error is Could not load type '[namespace].???'

Where ??? is the class name of every page I try to load

The web site (when executed within VS2008, local dev computer) works fine but once published (with no errors) and deployed to the server gives me Could not load type '[namespace].???' error

I did install elmah and I was able to get more details for this "generic" Could not load type '[namespace].???' error

elmah reports a HTTP error 500 :

System.Web.HttpException Could not load type '[namespace].???' -> System.Web.HttpParseException: Could not load type '[namespace].???'

Any ideas?

I have checked the "basics"

  • References
  • Doing a clean and a build
  • Checking the Inherits attr in the HTML against the code behind

UPDATE #1

I did deploy the site to a different DEV computer (configured IIS, virtual folder, etc.) and it works. When I use the same published code on the server, get the generic Could not load type '[namespace].???' error

UPDATE #2

I created a test web app. One form (Default.aspx) with a button. The click event does a Response.Write("Hello World"); I moved this app to the server and guess what, I get the Could not load type TestSite._Default

UPDATE #3

According to the fusion log viewer, these two websites are attempting to load CppCodeProvider and VJSharpCodeProvider, but I have no references to any of these. After a Google search, I found this post

I checked and I have no references to JAVA files. Still don't know what the problem is

like image 448
Mark Avatar asked Feb 07 '11 04:02

Mark


2 Answers

Strangely enough, sometimes we get this error when the disk is full.

like image 191
anar khalilov Avatar answered Oct 10 '22 13:10

anar khalilov


Make sure the project file is uploaded to the build server along with the added files. VS will add lines to this file that points to the new files location.

    <Content Include="xxx.aspx" />  

    <Compile Include="xxx.aspx.cs">
     <DependentUpon>xxx.aspx</DependentUpon>
     <SubType>ASPXCodeBehind</SubType>
    </Compile>

Without the updated project file it will not find the code behind.

like image 34
Chuck Nutting Avatar answered Oct 10 '22 11:10

Chuck Nutting