iis - NET Core 本地 IIS 如何确定应用程序池用户
问题描述
我在 Windows 10 上有 IIS。我在 .NET Core 3.0 中发布了网页,但出现错误:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File \\?\C:\inetpub\wwwroot\myapp\web.config
Requested URL http://localhost:80/myapp/
Physical Path C:\inetpub\wwwroot\myapp\
Logon Method Not yet determined
Logon User Not yet determined
我在网上查了一下,发现:
https://stackoverflow.com/questions/929131/how-do-i-resolve-http-error-500-19-internal-server-error-on-iis7-0
Looks like the user account you're using for your app pool doesn't have rights to the web site
directory, so it can't read config from there. Check the app pool and see what user it is
configured to run as. Check the directory and see if that user has appropriate rights to it. While
you're at it, check the event log and see if IIS logged any more detailed diagnostic information
there.
但我不知道应用程序池中用户的名称是什么。当我输入 DefaultAppPool 和检查名称时,它显示用户不存在。
如何检查该用户?
解决方案
与此案例类似的错误消息
请确保已安装 .net core webhosting bundle:
同时,请确保您正在通过 Web 部署工具部署项目。因为手动发布 IIS 不会自动注册 ASPNETCORE 处理程序。
进程内进程和进程外进程将具有不同的处理程序设置。
框架依赖:
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\MyApp.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
自给自足
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MyApp.exe"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1
推荐阅读
- c++ - 比较具有不同名称的相同类型
- python - 错误 - secure_channel() 在 bigquery 对象上使用 .to_dataframe() 获得了意外的关键字参数“default_scopes”
- matlab - 打开带有已编辑数据提示的 Matlab 图
- google-cloud-platform - Google Cloud Platform 数据流未加载或关闭
- php - 如何动态设置类中私有常量的值?
- node.js - Mongoose NodeJS macOS Big Sur MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
- javascript - 使用 forEach javascript 显示图像
- python - 使用列表中的随机值在 Pyspark 中创建数据框
- ruby-on-rails - 将数据库转储加载到 settings.local.yml
- javascript - 如何使用 useState 更新 initstate 的值数组?