在发布一个网站,在服务器上发布asp.net程序碰到了个问题,就是发布后浏览Login时报错,如下Server Application Unavailable 
The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. 
为了找原因,做如下简单的测试
前后台代码如下<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">    void Page_Load()
    {
        lblServerTime.Text = DateTime.Now.ToString();
    }
    
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>First Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    Welcome to ASP.NET 3.5! The current date and time is:
    
    <asp:Label
        id="lblServerTime"
        Runat="server" />
    
    </div>
    </form>
</body>
</html>但是单独右键打开这个文件时(IE方式)时报错如下无法显示 XML 页。 
无法查看使用 XSL 样式表的 XML 输入。请更正错误然后单击 刷新 按钮,或稍后重试。 
--------------------------------------------------------------------------------名称以无效字符开头。处理资源 'file:///E:/Users/Administrator/Desktop/FirstPage.aspx' 时出错。第 1 行,位置: 2 <%@ Page Language="C#" %>
-^
 
或者把后缀改成htm时,显示不出当前时间,只显示“Welcome to ASP.NET 3.5! The current date and time is: ”

解决方案 »

  1.   

    有没有安装.NET Framework,有没有注册asp.net,选择的.net版本是否和程序匹配。
      

  2.   

    有安装.NET Framework,程序是4.0版本。IIS中也为发布的那个目录设置了4.0有没有注册asp.net? 需要如何注册? 应该是没有注册过,过会我问问前台技术
      

  3.   

    注意,我做的那个简单测试是在我自己电脑的,没有弄过IIS,在服务器上应该是只抱下面这个错误Server Application Unavailable 
    The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. 
      

  4.   

    话说  就算是在本机 没设置过IIS  也不能右键打开网页浏览aspx文件?
    注:这里的aspx文件中时前后台代码都有的 就像楼主中发的那个代码一样
      

  5.   

    向iis注册asp.net:aspnet_regiis -i到开始菜单,找到VS-->配置工具选择-->Notification Services 输入命令aspnet_regiis -i回车就行
      

  6.   

    http://msdn.microsoft.com/zh-cn/library/k6h9cz8h(v=vs.80).aspx
      

  7.   

    如果是 安装了数据库在安装的IIS参考5楼   如果是没有安装好的话。那可以考虑卸载了从新装下看看。你本地程序发布有问题么