Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何设置Web.config:MVC_Html_Asp.net Mvc_Web Config - Fatal编程技术网

Html 如何设置Web.config:MVC

Html 如何设置Web.config:MVC,html,asp.net-mvc,web-config,Html,Asp.net Mvc,Web Config,当我试图访问我用MVC构建的网站时,我遇到了错误500。我联系了我的主机提供商,他们说问题出在我的web.config文件上。问题是,当我通过VisualStudio创建项目时,项目中没有一个 我按照此指南添加了一个:。这是由微软提供的 我在这里完全不知所措,因为我不知道需要什么样的信息,也不知道如何配置它以使其工作 以下是文件的当前内容: <?xml version="1.0" encoding="utf-8"?> <configuration> <!

当我试图访问我用MVC构建的网站时,我遇到了错误500。我联系了我的主机提供商,他们说问题出在我的web.config文件上。问题是,当我通过VisualStudio创建项目时,项目中没有一个

我按照此指南添加了一个:。这是由微软提供的

我在这里完全不知所措,因为我不知道需要什么样的信息,也不知道如何配置它以使其工作

以下是文件的当前内容:

<?xml version="1.0" encoding="utf-8"?>
<configuration>    
  <!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  <!--
  <system.webServer>
    <handlers>
      <remove name="aspNetCore"/>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
  -->
</configuration>


我要问的是我需要做些什么,以及为什么网站一开始没有包括这些内容。

你需要向你的提供商澄清,他们是否支持asp.net core,因为它有自己的运行库

此外,web.config与经典的ASP.NET框架相关,不适用于ASP.NET核心。 尝试在visual studio中使用任何.NET版本4.x创建应用程序。在模板中,您将看到web.config


如果您仍然想使用.NETCore,它将使用稍微不同的配置机制。您可以在asp.net core的教程部分阅读更多信息,我不清楚。您正在部署asp.net核心mvc应用程序吗?还是传统的framework.NETMVC应用程序?Visual studio将在新模板项目中为您创建一个web.config。你应该从这个开始。在visual studio中创建一个新项目,并从该web.config开始。