Friday, May 17, 2019

IIS Express always looks to appsettings.local.json

However, ending web.config like so in a .NET Core 2.1 application will allow appsettings.local.json to be read instead of appsettings.json when running in regular IIS.

      <aspNetCore processPath="bin\IISSupport\VSIISExeLauncher.exe"
            arguments="-argFile IISExeLauncherArgs.txt" stdoutLogEnabled="false">
         <environmentVariables>
            <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="local" />
         </environmentVariables>
      </aspNetCore>
   </system.webServer>
</location>

No comments:

Post a Comment