我用vs2012写的webform程序,.net版本4.5,用vs调试正常的,但是发布为文件系统后,上传到win2008服务器上,报错如下,什么原因啊!服务器上也装了.net4.5
Server Error in '/' Application.Parser ErrorDescription: 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 '测试服务器._default'.Source Error: 
Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="测试服务器._default" %>
Line 2:  
Line 3:  <!DOCTYPE html>Source File: /web/default.aspx    Line: 1 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.118.0

解决方案 »

  1.   

    问题我自己解决了,但是原因还是不明!以前webform做得少,没经验!解决办法是新建一个网站,把所有代码放在网站根目录下就OK了,出错是因为我把代码放在已有网站的虚拟目录下,难道vs写的项目解决方案只能放网站根目录下吗?上面出错的代码其实是没有任何代码的,纯粹是我测试用的!就是新建一个webform窗体,然后加入一个button,然后点击按钮时在网页上输出OK这一句代码,但是我编译生成后放到网站虚拟目录下就报上面的错,后来新建一个网站就ok了!为什么?
      

  2.   

    参考:
    http://www.cnblogs.com/insus/p/4468249.htmlhttp://www.cnblogs.com/insus/p/4466200.html