简体   繁体   English

ASP.NET 项目在 VS 运行时在本地运行,但不在本地计算机或服务器上的 IIS 上运行

[英]ASP.NET project works locally on build when VS is running but not on IIS on my local machine or my server

I published my asp.net (net core app 2.1) to windows 2012 r2 at localhost::80.我在 localhost::80 上将我的 asp.net(net core app 2.1)发布到了 windows 2012 r2。 It gives me the following error:它给了我以下错误:


HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. HTTP 错误 500.19 - 内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效。

Detailed Error Information: Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x8007000d Config Error详细错误信息:模块 IIS Web 核心通知未知处理程序尚未确定错误代码 0x8007000d 配置错误
Config File \\web.config Requested URL :80/ Physical Path配置文件 \\web.config 请求的 URL :80/ 物理路径
Logon Method Not yet determined Logon User Not yet determined登录方法 尚未确定 登录用户 尚未确定


As far as I checked, the error seems to be in web.config I'll put the web.config in the code section.据我检查,错误似乎在 web.config 中,我会将 web.config 放在代码部分。

I have tried deleting the web.config and enabling directory browsing, making an index.html load index.cshtml but that won't work because MVC.我尝试删除 web.config 并启用目录浏览,使 index.html 加载 index.cshtml 但这不起作用,因为 MVC。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <modules>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <!-- Remove WebDAV module so that we can make DELETE requests -->
      <remove name="WebDAV" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <!-- When deploying on Azure, make sure that "dotnet" is installed and the path to it is registered in the PATH environment variable or specify the full path to it -->
    <aspNetCore requestTimeout="23:00:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600">
      <environmentVariables />
    </aspNetCore>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

I expected it to start but as it happens I get the error.我希望它开始,但碰巧我收到错误。 Thank you for your help.感谢您的帮助。

我遇到了同样的错误,我通过使用 IIS 管理器中的 Web 平台安装程序安装 URL 重写来解决它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 部署 ASP.NET Core Docker 项目 - 收到 405 错误(在我的 IIS 本地,Web 请求有效)。 如何解决? - Deploy ASP.NET Core Docker project - get a 405 error (locally in my IIS, web requests works). How to fix it? asp.net c# 代码(从 VS2022 和 IIS10)在本地机器上工作以连接到 SQL Server DB 它在 Web 服务器上不起作用 - asp.net c# code works (from VS2022 and on IIS10) on local machine to connect to SQL Server DB it does not work on Webserver 运行 exe 的 ASP.NET Web 应用程序在 VS 中工作,而不是在 IIS 中 - ASP.NET Web application running an exe works in VS, not in IIS 我如何将我的asp.net项目发布到我的本地iis? - how do i publish my asp.net project to my local iis? 为什么我的机器需要完整的IIS重置才能看到ASP.NET项目的代码更改? - Why would my machine need a full IIS reset to see code changes to an ASP.NET project? 我打算何时建立项目的ASP.NET - ASP.NET when am I meant to build my project asp.net CSS在我的本地计算机和远程计算机中有所不同 - asp.net css is different in my local machine and remote machine ASP.NET 项目适用于 IIS 服务器,但不适用于 localhost - ASP.NET project works on IIS server but not on localhost ASP.Net 页面在本地工作但在推送到服务器时失败 - ASP.Net Page Works Locally But Fails When Pushed To Server 无法在我的机器上运行特定的 ASP.NET 项目。 Rider 和 VS2019 - Can't run a specific ASP.NET project on my machine. Both Rider and VS2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM