积极答复者
windows installer 应用asp.net的问题

问题
-
“/xxx”应用程序中的服务器错误。
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误信息: 未能加载类型“helloweb._Default”。
源错误:
行 1: <%--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %>--%> 行 2: 行 3: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %> 行 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 行 5:
源文件: /xxx/Login.aspx 行: 3
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433
本人利用vs2005上的windows installer部署asp.net 应用程序,打包后访问该网址
报错
“/MsiWebDeploy”应用程序中的服务器错误。
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误信息: 未能加载类型“helloweb._Default”。
源错误:
行 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %>
行 2:
行 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
源文件: /msiwebdeploy/Login.aspx 行: 1
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433
于是我以为是缺少文件, 从本地目录拷贝一些文件到目标目录,报错如下,可是在原目录里面没有global.asax文件啊。咋办
“/MsiWebDeploy1”应用程序中的服务器错误。
--------------------------------------------------------------------------------
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误信息: 未能加载类型“HelloWeb_cs.Global”。
源错误:
行 1: <%@ Application Codebehind="Global.asax.cs" Inherits="HelloWeb_cs.Global" %>
源文件: /MsiWebDeploy1/global.asax 行: 1
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433
我该咋办?
答案
-
软件安装包推荐使用WiX,Wix 是 Windows Installer XML 的缩写,它是微软提供的一组工具和规范用来制作MSI格式的安装包。我正在研究WiX,有兴趣参看我写的文章:http://www.cnblogs.com/shanyou/category/167184.html 。
全部回复
-
copy 过去完全正常,用windows installer打包出现如下错误,咋办?
“/xxx”应用程序中的服务器错误。
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误信息: 未能加载类型“helloweb._Default”。
源错误:
行 1: <%--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %>--%> 行 2: 行 3: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %> 行 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 行 5:
源文件: /xxx/Login.aspx 行: 3
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433 -
谢谢版主,可是在打包前,把所有文件拷贝至web共享文件夹是完全可以打开的,而打包就不行.helloweb._Default是啥东西?是文件么?
附上原文件,windows installer里面设置login.aspx为defaultDocument.
Login.aspx 原文件如下
- HTML code
- <%--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %>--%> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %> <!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>无标题页</title> </head> <body> <form id="form1" runat="server"> <div> <br /> <table> <tr> <td style="width: 100px"> <asp:Label ID="Label1" runat="server" Text="Email Address"></asp:Label></td> <td style="width: 100px"> <asp:TextBox ID="UserName" runat="server"></asp:TextBox></td> <td style="width: 172px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Email Address Required" ControlToValidate="UserName" Font-Strikeout="True"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Invalid Email Format" ControlToValidate="UserName" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td> </tr> <tr> <td style="width: 100px; height: 26px;"> <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label></td> <td style="width: 100px; height: 26px;"> <asp:TextBox ID="Password" runat="server"></asp:TextBox></td> <td style="width: 172px; height: 26px;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Password Required" ControlToValidate="Password"></asp:RequiredFieldValidator></td> </tr> <tr> <td style="width: 100px; height: 26px"> <asp:Label ID="Label3" runat="server" Text="Re-Enter Password"></asp:Label></td> <td style="width: 100px; height: 26px"> <asp:TextBox ID="Password2" runat="server" OnTextChanged="Password2_TextChanged"></asp:TextBox></td> <td style="width: 172px; height: 26px"> <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Passwords do not match" ControlToCompare="Password" ControlToValidate="Password2"></asp:CompareValidator></td> </tr> <tr> <td style="width: 100px"> </td> <td style="width: 100px"> <asp:Button ID="LogIn" runat="server" OnClick="LogIn_Click" Text="Log in" /></td> <td style="width: 172px"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" HeaderText="出错啦" /> </td> </tr> </table> </div> </form> </body> </html>
login.aspx.cs如下
- C# code
- using System; using System.Data; using System.Configuration; using System.Collections; 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; namespace helloweb { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Response.Write("<h1>You r now Logged in</h1>"); } protected void LogIn_Click(object sender, EventArgs e) { if (UserName.Text == "jason@fladotnet.net" && Password.Text == "password") { Response.Redirect(@"Success.aspx"); } //following is the code which is old but ok. //Response.Write(UserName.Text); //Response.Write("<br>"); //Response.Write(Password.Text); //Response.End(); } protected void Password2_TextChanged(object sender, EventArgs e) { } } }
-
谢谢版主,可是在打包前,把所有文件拷贝至web共享文件夹是完全可以打开的,而打包就不行.helloweb._Default是啥东西?是文件么?
附上原文件,windows installer里面设置login.aspx为defaultDocument.
Login.aspx 原文件如下
-
Code Snippet
-
HTML code
-
<%--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %>--%><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="helloweb._Default" %><!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>无标题页</title></head><body> <form id="form1" runat="server"> <div> <br /> <table> <tr> <td style="width: 100px"> <asp:Label ID="Label1" runat="server" Text="Email Address"></asp:Label></td> <td style="width: 100px"> <asp:TextBox ID="UserName" runat="server"></asp:TextBox></td> <td style="width: 172px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Email Address Required" ControlToValidate="UserName" Font-Strikeout="True"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Invalid Email Format" ControlToValidate="UserName" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td> </tr> <tr> <td style="width: 100px; height: 26px;"> <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label></td> <td style="width: 100px; height: 26px;"> <asp:TextBox ID="Password" runat="server"></asp:TextBox></td> <td style="width: 172px; height: 26px;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Password Required" ControlToValidate="Password"></asp:RequiredFieldValidator></td> </tr> <tr> <td style="width: 100px; height: 26px"> <asp:Label ID="Label3" runat="server" Text="Re-Enter Password"></asp:Label></td> <td style="width: 100px; height: 26px"> <asp:TextBox ID="Password2" runat="server" OnTextChanged="Password2_TextChanged"></asp:TextBox></td> <td style="width: 172px; height: 26px"> <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Passwords do not match" ControlToCompare="Password" ControlToValidate="Password2"></asp:CompareValidator></td> </tr> <tr> <td style="width: 100px"> </td> <td style="width: 100px"> <asp:Button ID="LogIn" runat="server" OnClick="LogIn_Click" Text="Log in" /></td> <td style="width: 172px"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" HeaderText="出错啦" /> </td> </tr> </table> </div> </form></body></html>
login.aspx.cs如下-
C# code
-
using System;using System.Data;using System.Configuration;using System.Collections;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;namespace helloweb{ public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Response.Write("<h1>You r now Logged in</h1>"); } protected void LogIn_Click(object sender, EventArgs e) { if (UserName.Text == "jason@fladotnet.net" && Password.Text == "password") { Response.Redirect(@"Success.aspx"); } //following is the code which is old but ok. //Response.Write(UserName.Text); //Response.Write("<br>"); //Response.Write(Password.Text); //Response.End(); } protected void Password2_TextChanged(object sender, EventArgs e) { } }}
-
-
-
刚才我试着用右键点击这个项目,弹出 发布 菜单,
我发布到以下网址:
接下来,访问http://localhost/trykillme/login.aspx 竟然成功了,真是神奇。。。
接下来,是不是可以打包啦,可是怎么打呢,我在(以前添加新建项目-web安装项目-生成的项目)里面试图添加 项目输出
可是没有找到trykillme的选项,咋办?
-
软件安装包推荐使用WiX,Wix 是 Windows Installer XML 的缩写,它是微软提供的一组工具和规范用来制作MSI格式的安装包。我正在研究WiX,有兴趣参看我写的文章:http://www.cnblogs.com/shanyou/category/167184.html 。