从Visual Studio发布到Azure时如何防止web.config还原

时间:2018-09-21 12:59:50

标签: visual-studio azure asp.net-core web-config publishing

当我将.net核心应用发布为Azure时,web.config似乎恢复为其他内容,我不知道为什么。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
    <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" />
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="300000000" maxUrl="102410" maxQueryString="204810" />
        </requestFiltering>
    </security>
    <applicationInitialization>
        <add initializationPage="/" />
    </applicationInitialization>
 </system.webServer>
</configuration>

但是到达服务器的是这样的:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
<handlers>
  <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\App.UI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
 </system.webServer>
</configuration>

安全性和初始化过程部分完全消失。这是怎么回事?

0 个答案:

没有答案