ASP.NET之旅(四):IIS网站部署步骤及常见错误

写ASP.NET程序已经有几年了,可是每每将网站或者Web应用程序部署到IIS上的时候,还总是出错。每次都需要查看错误信息,甚至搜索网络找到处理方法,于是这一次来了个全程记录,把步骤和遇到的问题都记下来,与同道共享:)

1、在IIS中创建虚拟目录(WebSite)或者应用程序(WebApp);

  注意:发布的程序必须创建应用程序,否则出错如下:

Parser Error Message: Could not load the assembly 'App_Web_nqebt6fg'. Make sure that it is compiled before accessing the page.

Source Error: 

Line 1:  <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_nqebt6fg" %>

2、给IIS_IUSRS和IUSR赋予虚拟目录读写权限,否则出错如下:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

3、设置“认证”属性,启用“仿冒”,否则出错如下:   ---这个主要会是权限的问题 ,

随便找到一个上层文件夹,点属性->安全->共享->添加everyone回复  就OK了

HTTP Error 401.3 - Unauthorized

You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

4、设置应用程序池为“经典模式”(如果需要的话),否则出错如下:

HTTP Error 500.24 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

5、在连接字符串中不要使用集成安全,而是使用用户名/密码(如果不是Windows认证的话),否则出错如下:

  Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\IUSR'.

6、

7、

8、

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值