.net的程序无法正常运行,该怎么排除?

laughfox 2002-12-31 11:44:52
我的系统是win2000server是用正版软件装的,IIS也是一并装好了的。但是昨天被我不小心在添加组件中把它删除了。但是手上没有那张正版盘,我就用了一张三合一的D版盘把IIS恢复了,恢复过程没有任何出错提示。但是安装成功后.net的程序就无法正常运行。我用了如下的一个测试程序:
test.aspx
内容为
<html>
<body>
aspx page
<asp:Label id="test" Text="Text from a Label control object" runat="server" />
</body>
</html>
结果浏览器中只显示:
aspx page
在浏览中用右击“查看源文件”竟然把.aspx文件的内容全部显示出来了!
是不是不正常?
我重新把.net framework删除再重装了,结果还是一样
我以前的.net的程序也不能运行,以前的程序是用C#编译的。
IIS运行asp程序大概没问题,因为我可以使用它的帮助功能,在浏览进行IIS管理。
因为我才刚刚学习.net问题希望各位指教:
1。我的IIS是不是有问题?是不是因为那个三合一的D版引起的?如果我用个纯server的D版盘是不是可以解决问题?
2。我以前的C#程序如果要正常运行需要安装.net framework SDK吗?在什么情况下会使用到这个SDK?
3。哪位可以给出微软的网站上下载IIS安装程序的链接吗?因为要拿到那张正版实在是有困难,下次如果那张正版在手上的话,可不可把它上面的所有文件拷贝到硬盘上使用,会不会影响功能?
4。还有其它更好的解决办法吗?

各位高手多帮忙,好急!!!!!!
...全文
179 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
koomis 2003-01-03
  • 打赏
  • 举报
回复
你試試看在CMD窗口中輸入
ASPNET_REGIIS -I
然後你的系統就會正常了吧。
laughfox 2003-01-03
  • 打赏
  • 举报
回复
结帖:
现在已恢复正常,是按如下方法处理:
1。按如下顺序卸载.net framework->IIS
2.按如下顺序安装iis(server与adv server都可以)->更新补丁->mdac2.7->.net framework->在.net framework的安装目录下运行:ASPNET_REGIIS -I

我的程序在绝大部分机器上可以用了!但还是有一台服务器上不能用(win2000 server sp3),不过我也懒得弄了,有一台可以运行就行了。

结论就是:微软的东西不敢恭维,重新安装了.net framework还要运行一下注册才行?!
ZHANG9652 2003-01-02
  • 打赏
  • 举报
回复
哎呀,你要到服务器上才能看到错误的正确描述嘛
yohomonkey 2003-01-02
  • 打赏
  • 举报
回复
要从装你的framework。
ZHANG9652 2003-01-02
  • 打赏
  • 举报
回复
好像和IE版本有关系
csdn_bob 2003-01-01
  • 打赏
  • 举报
回复
如果你安装的.net framework是中文正式版的话,asp.net就已经在里面了(不用再安装),如果不是就要到ms去下载!至于怎么注册asp.net,安装asp.net 就会自己注册了!
你手头有vs.net的话,在里面就有!
laughfox 2003-01-01
  • 打赏
  • 举报
回复
csdn_bob(文子):
还有一些不明:
1。要如何注册ASP。NET?
2。我指的是SDK出要不要安装?
3。希望IIS没问题就好
4。asp.net是如何安装的?用什么安装?
csdn_bob 2003-01-01
  • 打赏
  • 举报
回复
1:可能不是iis 的问题,可能是你删除了以前的iis ,而新安装的iis并没有注册asp.net!
2:也要!因为就算编译了也要有.net framework支持!
3:不是iis的问题!
4:重新安装iis->.net framework->asp.net
csdn_bob 2003-01-01
  • 打赏
  • 举报
回复
是你的程序的错误了,是不是没有设置应用程序!iis中!
laughfox 2003-01-01
  • 打赏
  • 举报
回复
运行后的结果是:
Server Error in '/Bpms' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

要如何改正啊?
laughfox 2003-01-01
  • 打赏
  • 举报
回复
现在我有可以运行那个test.aspx文件了,但原来的程序还不行请各位帮忙看看:
文件:login.aspx的内容如下:

<%@ Page language="c#" Codebehind="Login.aspx.cs" AutoEventWireup="false" Inherits="Query.Login" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<SCRIPT LANGUAGE="JavaScript">
if(top!=self)top.location = location;
</SCRIPT>
<HTML>
<HEAD>
<meta content="Microsoft FrontPage 5.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript (ECMAScript)" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout" topmargin="0" leftmargin="0">
<form id="Login" method="post" runat="server">
<FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体">
</FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT>
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="100%">
<tr>
<td width="100%" height="119">
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="WIDTH: 245px; BORDER-COLLAPSE: collapse; HEIGHT: 114px" bordercolor="#111111" width="245" id="AutoNumber2" height="114">
<tr>
<td width="100%" height="28" align="middle" colspan="2" bgcolor="#ffffcc">
<p align="center">
<FONT face="宋体">
<asp:label id="Label1" runat="server">用户登录</asp:label>
</FONT>
</p>
</td>
</tr>
<tr>
<td width="30%" height="28" align="middle">
用户名:
</td>
<td width="70%" height="28">
<asp:textbox id="TextBox1" runat="server" Width="166px" Height="26px" BackColor="White" BorderWidth="1px"></asp:textbox>
</td>
</tr>
<tr>
<td width="30%" height="28" align="middle">
密  码:
</td>
<td width="70%" height="28">
<FONT face="宋体">
<asp:textbox id="TextBox2" runat="server" TextMode="Password" Width="166px" Height="26px" BackColor="White" BorderWidth="1px"></asp:textbox>
</FONT>
</td>
</tr>
<tr>
<td width="100%" height="28" colspan="2">
<p align="center">
<asp:LinkButton id="LinkButton2" runat="server">用户注册</asp:LinkButton>
<FONT face="宋体">      </FONT>
<asp:linkbutton id="LinkButton1" runat="server">登录</asp:linkbutton>
</p>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</form>
</body>
</HTML>
ZHANG9652 2003-01-01
  • 打赏
  • 举报
回复
要重新安装。NET FRAMEWORK呀,光重新安装IIS怎么行,他不认识ASPX文件嘛

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧