下载了一个免费的启动模板,并获得了整个解决方案的zip存档。
在打开windows上的存档时,我收到了一条消息,询问是否覆盖现有的web.config文件。实际上,在/src/myapp.Web.Host/下面有两个web.config文件。这两个文件名在第一个字母的大小写不同。
一个名为Web.config,另一个命名为web.config,内容不同。我该用哪一种?
所使用的备选方案:
发布于 2018-06-29 12:01:11
在问题解决之前,您可以使用这个web.config内容.我试过了,效果很好。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<!-- ASPNET CORE SETTINS -->
<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"
startupTimeLimit="3600"
requestTimeout="23:00:00" />
<!-- REMOVE INFO LEAK HEADERS -->
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
<!-- MIME TYPES -->
<staticContent>
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff" />
</staticContent>
<!-- IIS URL Rewrite for Angular routes -->
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>https://github.com/aspnetboilerplate/aspnetboilerplate/files/2149283/Web.config.zip
https://stackoverflow.com/questions/51098278
复制相似问题