移动到其他IIS服务器PC后在IIS中发布的ASP.NET Core Web API出现错误500.19(0x8007000d) [英] asp.net core web api published in IIS after moved to different IIS server pc gives error 500.19 (0x8007000d)

查看:557
本文介绍了移动到其他IIS服务器PC后在IIS中发布的ASP.NET Core Web API出现错误500.19(0x8007000d)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2015在asp.net核心版本1.0.1中开发了一个Web api,当我在与开发它的PC相同的IIS 10中发布了该Web api时,一切正常.当我将Web api的发布文件夹复制并粘贴到另一台PC时,出现问题,浏览器显示错误500.19 Internal Server Error,错误代码0x8007000d,无法访问请求的页面,因为该页面的相关配置数据无效",这会导致web.config中出现一些问题. 我认为IIS的版本不是问题所在,因为从IIS 10迁移到IIS 8或从IIS8迁移到IIS 10会产生相同的错误,并且在具有IIS 10的两台PC之间也会发生相同的错误. 我已经审查了几个相关问题,例如元素'system ".webServer"具有无效的子元素"aspNetCore" ,以及其他与web.config文件相关的元素,似乎在其中发现了错误.开发环境中的web.config文件为:

I developed a web api in asp.net core version 1.0.1 using visual studio 2015, when I published the web api in IIS 10 of the same pc where it was developed, everything works correctly. The problem arises when I copy and paste the publication folder of the web api to a different pc, the browser shows the error 500.19 Internal Server Error, error code 0x8007000d, "The requested page can not be accessed because the related configuration data for the page is invalid ", which leads to some problem in the web.config. I do not think the version of IIS is the problem because moving from IIS 10 to IIS 8 or from IIS8 to IIS 10 gives the same error, and the same happens between two pcs with IIS 10. I have already reviewed several related issues, like, The element 'system.webServer' has invalid child element 'aspNetCore', and others related to web.config file where it seems the error is found. The web.config file in the development environment is:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
    -->
     <system.webServer>
      <handlers>
       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
      </handlers>
      <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
     </system.webServer>
    </configuration>

发布网络api后,web.config文件如下所示:

After publish the web api, the web.config file looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->
 <system.webServer>
  <handlers>
   <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
  </handlers>
  <aspNetCore processPath="dotnet" arguments=".\buildingSecureWebApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
 </system.webServer>
</configuration>

无论发布什么计算机,此web.config文件都具有相同的内容.

This web.config file has the same content no matter what computer was publish.

关于我的问题的解决方案的一些想法,我需要将Web API安装在任何版本的Windows中,直到现在它仅能在开发的PC上正常工作.

Some idea of ​​what the solution to my problem may be, I need to mount the web api in any version of windows and until now it only works correctly on the pc that was developed.

推荐答案

要获取更详细的错误消息:

  1. 验证日志目录是否存在于Web配置引用的路径中.如果没有,请创建它.配置中显示的路径会将"logs"目录放置在已部署站点的根文件夹中.

  1. Verify that the log directory exists at the path referenced by the web config. If it does not, create it. The path shown in your config would place the "logs" directory in the root folder of the deployed site.

验证应用程序池对日志目录和

Verify that the application pool has write access to the logs directory and

验证该`stdoutLogEnabled ="true".

Verify that `stdoutLogEnabled="true".

如果您已验证所有这三个项目,那么您应该获得包含错误更详细说明的日志条目

If you have verified all 3 of these items, then you should get log entries that will contain a more detailed description of the error

是什么引起"500.19内部服务器错误,错误代码0x8007000d"错误?

  • .NET Core托管捆绑包未安装在部署站点的Web服务器上.为了解决这个问题,请下载 .NET Core Windows Server Hosting包
  • 您可能还想验证dotnet可执行文件的路径是否存在于部署计算机的环境变量中.要检查这一点,请首先找到dotnet.exe的安装路径.它通常位于C:\Program Files\dotnetC:\Program Files (x86)\dotnet中.知道路径后,请确保该路径存在于您的环境变量中.
  • .NET Core hosting bundle is not installed on the webserver where the site is deployed. To remedy this, obtain this download .NET Core Windows Server Hosting bundle
  • You may also want to verify that the path to the dotnet executable exists in the deployment machine's environment variables. To check this, first find the path where dotnet.exe is installed. It is generally located in either C:\Program Files\dotnet or C:\Program Files (x86)\dotnet. Once you know the path, ensure that the path exists in your Environment Variables.

控制面板>系统>高级系统设置>环境变量.突出显示路径",单击编辑",并验证是否存在dotnet文件夹的路径.如果不是,请添加它.对用户变量和系统变量执行相同的操作.重新启动计算机,然后重试.

Control Panel > System > Advanced System Settings > Environment Variables. highlight "Path", click 'Edit' and verify that the path to the dotnet folder is present. If it isn't, add it. Do the same for both the User variables and System variables. Restart your machine and try again.

这篇关于移动到其他IIS服务器PC后在IIS中发布的ASP.NET Core Web API出现错误500.19(0x8007000d)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆