第一个问题:在安装Microsoft Visual Studio .NET2003时,没有安装IIS,而是后安装的IIS,这种情况下,创建web应用时会报错
解决方法:在命令提示窗口中运行如下命令即可:
%windir%/Microsoft.NET/Framework/v1.1.4322/aspnet_regiis.exe -i
第二个问题:关于IIS的配置,在安装完IIS后最好做如下配置,否则在运行Web应用时可能会报一些权限方面的错误
解决方法:
第一步:打开IIS,右键单击 Default Web Site -----〉Properties
第二步:在弹出的窗口中,单击 Directory Security -----> Edit...
第三步:在弹出的窗口中,选中最下方的 Integrated Windows authentication复选框
第四步:一路点击OK即可
第三个问题:在Web Application中使用Web Service代理类时出现的问题,运行时报如下所示的页面错误
The request failed with HTTP status 401: Access Denied.
例如:WebForm1.aspx.cs中有如下代码:
private void Page_Load(object sender, System.EventArgs e)
{
webService.Service1 ss=new WebApplication1.webService.Service1();
Response.Write(ss.HelloWorld());
}
其中,webService.Service1是一个Web Service代理类
解决方法:增加一行代码(如下所示的红色代码)即可
private void Page_Load(object sender, System.EventArgs e)
{
webService.Service1 ss=new WebApplication1.webService.Service1();
ss.Credentials=System.Net.CredentialCache.DefaultCredentials;
Response.Write(ss.HelloWorld());
}
初学ASP.NET开发web应用时遇到的一些常见问题和解决方法
精选 转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Asp.Net Core 配置动态WebApi
.Net Core 配置动态WebApi
动态生成 Web 应用服务 -
空Asp.net(Web程序应用程序)生成失败
开发环境:Win10 C#2013生成失败,无提示信息,错误信息。解决方法:启用IIS
IIS c# 解决方法 开发环境 -
ASP.NET Web应用程序发布到IIS
ASP.NET Web应用程序发布到IIS一、发布前的准备工作1.检查数据库连接字符串2.检查数据库登录名二、发布(以MVC程序为例)1.
iis windows asp.net 网站发布 IIS -
ASP.NET 2.0中WEB应用程序的部署
新近编译的一篇文章,发表在天极网上(http://dev.yesky.com/msdn/348/2014848.shtml)
asp.net web html 应用程序 -
asp.net网站和新建项目里ASP.NET Web应用程序区别
asp.net网站和新建项目里ASP.NET Web应用程序区别总体来说,ASP.NET网站适用于较小的网站开发,因为其动态编译的特点,无需整站编译。
asp.net 程序集 web应用 应用程序 web工程