小编Des*_*sus的帖子

ASP.net核心1.0 web.config被覆盖导致CGI异常

我有一个工作web.config,如下所示:

<?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=".\Example.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

但不知何故Visual Studio正在将我的web.config更新为:

<?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="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

这可以通过发布菜单在Visual Studio中工作(并且一旦部署到azure web应用程序就可以工作).但是,如果我使用dotnet发布等dotnet CLI,它就不起作用,因为它保持带有变量的web.config:%LAUNCHER_PATH%和%LAUNCHER_ARGS%而不是我想要的:dotnet和.\ Example.dll.

注意:在使用dotnet restore和dotnet …

.net asp.net build visual-studio-2015 asp.net-core

6
推荐指数
1
解决办法
1285
查看次数

标签 统计

.net ×1

asp.net ×1

asp.net-core ×1

build ×1

visual-studio-2015 ×1