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

发布于 2022-09-06 08:43:03 字数 1929 浏览 13 评论 0

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

眼眸里的快感 2022-09-13 08:43:11

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

烙印 2022-09-13 08:43:11

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.

〆凄凉。 2022-09-13 08:43:11

Really weird, maybe you should try to test it in a different server, this happens for example when you are using in you dev environment some namespaces from .NET 4.5 and you haven't installed the same framework in your server, so maybe the error is related to this behavior, if you are not using any third dll in your web application outside Microsoft's framework, so should try to reinstall the framework, I don't think the problem is related to visual studio.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文