在vs2005里建了个asp.net站点后,调试都是正常的可以浏览网站...但是等发布网站到我指定的目录以后我在IIS里在该指定目录下创建了虚拟目录后浏览网站就出现以下错误:
在bin目录下生成了一个dll文件的App_Web_ho4fzc3n.dllServer Error in '/testCodebehind3' Application.
--------------------------------------------------------------------------------Parser 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 the assembly 'App_Web_ho4fzc3n'. Make sure that it is compiled before accessing the page.Source Error: 
Line 1:  <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_ho4fzc3n" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 Source File: D:\赵果\代码\web game\Game1\testCodebehind3\Default.aspx    Line: 1 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 谁能帮帮我啊...我是新手...请大家帮下帮吧!!!我就50分了全送了!!!!
Default.aspx页代码:
<%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_ho4fzc3n" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>测试Codebehind</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="joy" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>
Default.aspx.cs页代码:using System;
using System.Drawing;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page 
{
    public _Default()
{
Page.Init +=new System.EventHandler(Page_Init);
}

protected void Page_Load(object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
joy.Text="Hello World!!!";
    Random rnd=new Random();
Color c=Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
joy.ForeColor=c;
}
}

protected void Page_Init(object sender,EventArgs e)
{
InitializeComponent();
}

private void InitializeComponent()
{
this.Load+=new System.EventHandler(this.Page_Load);
}
}

解决方案 »

  1.   

    .NET Framework Version:应该是2.0在IIS配置一下就可以了。Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 
      

  2.   

    你的网站右键->属性->Asp.Net选项卡->Asp.Net版本选择2.0.*****
      

  3.   

    首先,服务器上的ASP.NET版本是1.1的,你先搞成2.0的。其他的在说
      

  4.   

    太感谢各位了...我把IIS里的版本改成2.0就行了...谢谢了!!!!!回答的我都给分吧!!!HOHO~~~