title: How to prevent auto-generated web.config in Asp.Net Core API 3.1 while running the application using visual studio 2019?
body: <p>I am developing Asp.Net Core 3.1 API, It's working as expected.</p>
  <p>When I run it automatically converts the original web.config to a new one.</p>
  <p><strong>Original Web.config file:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;location path=&quot;.&quot; inheritInChildApplications=&quot;false&quot;&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath=&quot;dotnet&quot; arguments=&quot;.\EngageAPI.dll&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; hostingModel=&quot;inprocess&quot; /&gt;
      &lt;/system.webServer&gt;
    &lt;/location&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p><strong>New web.config</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;location path=&quot;.&quot; inheritInChildApplications=&quot;false&quot;&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath=&quot;%LAUNCHER_PATH%&quot; arguments=&quot;%LAUNCHER_ARGS%&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; hostingModel=&quot;inprocess&quot;&gt;
          &lt;environmentVariables&gt;
            &lt;environmentVariable name=&quot;COMPLUS_ForceENC&quot; value=&quot;1&quot; /&gt;
            &lt;environmentVariable name=&quot;ASPNETCORE_ENVIRONMENT&quot; value=&quot;Development&quot; /&gt;
          &lt;/environmentVariables&gt;
        &lt;/aspNetCore&gt;
      &lt;/system.webServer&gt;
    &lt;/location&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>So I have two questions.</p>
  <ol>
  <li>Why is it getting autogenerated?</li>
  <li>How can I stop this auto-generation?</li>
  </ol>
  <p><strong>Update:</strong></p>
  <p><strong>Adding more clarification to the question:</strong></p>
  <p>why is it causing the issue? I am doing the deployment from azure dev ops. and what I do I copy the web.config from my project to the package which I am creating. and noted this web.config is modified to the new web.config (which has %LAUNCHER_PATH% %LAUNCHER_ARGS%) when you run the code from VS. So basically we don't need to copy this web.config. instead of this, we need to copy the one which gets generated in the publish folder.</p>
  <p>CsProj file</p>
  
  <pre><code>  &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Folder Include=&quot;Models\&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;AutoMapper.Extensions.Microsoft.DependencyInjection&quot; Version=&quot;7.0.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Dapper&quot; Version=&quot;2.0.35&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Azure.Storage.Blob&quot; Version=&quot;11.1.7&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Azure.Storage.Common&quot; Version=&quot;11.1.7&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Extensions.Logging.Log4Net.AspNetCore&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Design&quot; Version=&quot;3.1.3&quot; /&gt;
      &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore&quot; Version=&quot;5.5.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Swashbuckle.AspNetCore.Filters&quot; Version=&quot;5.1.1&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Data.SqlClient&quot; Version=&quot;4.8.1&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  
  &lt;/Project&gt;
  </code></pre>