.netcore 发布IIS问题整理404

Netcore5 发布IIS

问题1:报404错误 

解决方案:需要安装 AspNetCoreModeuleV2

文档地址 https://dotnet.microsoft.com/download/dotnet/5.0

 

 问题2:报错信息:

Error.

An error occurred while processing your request.

Request ID: 00-84505f59efe45c4f986b977926902b81-b2da05dfbb855941-00

Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

解决方案:需要修改配置文件

<aspNetCore processPath=".\Application.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">

<environmentVariables>

<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />

</environmentVariables>

</aspNetCore>

<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />

修改为:

<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />

问题3:报错信息:

An unhandled exception occurred while processing the request.

异常详细信息: System.Data.SqlClient.SqlException:用户 'IIS APPPOOL\DefaultAppPool' 登录失败解决办法

解决方案:

打开 Microsoft SQL Server Management Studio 

1.安全性---登录名---新建登录名

 

 

2.常规----搜索

 

 

3.添加SERVICE用户--

 

 

 

 

 

4.服务器角色---勾上sysadmin:

 

 

 

IIS中:

应用程序池---对应的程序池上右键---高级设置

进程模块---标识---选择NetworkService(与数据库中设置统一)

 

 

 

 

 

 

 

 

posted @ 2021-10-27 14:26  哈佛  阅读(1245)  评论(0编辑  收藏  举报