title: HTTP Error 500.19 - Internal Server Error on putting a Asp.net MVC web api project to Docker container
body: <p>I'm trying a lift and shift of a Asp.Net MVC Web Api project to a docker container. I am successfully able to build and deploy the project but on pinging the site i get a   HTTP Error 500.19 - Internal Server Error
  
  The logs detailed by the container are as below  : </p>
  
  <p>HTTP Error 500.19 - Internal Server Error
    The requested page cannot be accessed because the related configuration data
  for the page is invalid.</p>
  
  <p>Detailed Error Information:</p>
  
  <pre><code>Module&amp;nbsp;&amp;nbsp;&amp;nbsp;IIS Web Core
  Notification&amp;nbsp;&amp;nbsp;&amp;nbsp;Unknown
  Handler&amp;nbsp;&amp;nbsp;&amp;nbsp;Not yet determined
  Error Code&amp;nbsp;&amp;nbsp;&amp;nbsp;0x8007000d
  Config Error&amp;nbsp;&amp;nbsp;&amp;nbsp;
  </code></pre>
  
  <p>Config File&nbsp;&nbsp;&nbsp;\?\C:\inetpub\wwwroot\web.config</p>
  
  <pre><code>Requested URL&amp;nbsp;&amp;nbsp;&amp;nbsp;http://localhost:80/
  Physical Path&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Logon Method&amp;nbsp;&amp;nbsp;&amp;nbsp;Not yet determined
  Logon User&amp;nbsp;&amp;nbsp;&amp;nbsp;Not yet determined
  Config Source:
     -1:
  0:
  </code></pre>
  
  <p>More Information:
    This error occurs when there is a problem reading the configuration file for
  the Web server or Web application. In some cases, the event logs may contain
  more information about what caused this error.
    View more information &raquo;</p>
  
  <p>The dockerfile is as structured like this </p>
  
  <pre><code># escape=`
  FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-ltsc2019 AS builder
  
  WORKDIR C:\src
  COPY . .
  RUN nuget restore Solutions\*.Web.sln 
  RUN msbuild MyApp.csproj /p:OutputPath=c:\out /p:Configuration=Dev    
  
  # app image
  FROM microsoft/aspnet:4.7.2-windowsservercore-ltsc2016
  SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
  
  ENV APP_ROOT=C:\inetpub\wwwroot `
      APP_LOGS=C:\logs `
      COLLECTOR_CONFIG_PATH="w3svc-collectors.json"    
  WORKDIR ${APP_ROOT}
  
  RUN powershell remove-item C:\inetpub\wwwroot\iisstart.*
  
  RUN powershell -Command Add-WindowsFeature NET-WCF-HTTP-Activation45
  RUN Import-Module WebAdministration; `
      Set-ItemProperty 'IIS:\AppPools\DefaultAppPool' -Name processModel.identityType -Value LocalSystem; 
  
  VOLUME ${APP_LOGS}
  COPY --from=builder C:\out\IIsStartup.ps1 /
  ENTRYPOINT ["powershell", "/IIsStartup.ps1"]
  
  COPY --from=builder C:\out\_PublishedWebsites\ ${APP_ROOT}
  EXPOSE 80
  
  
  
  
  &lt;?xml version="1.0"?&gt;
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    --&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
    &lt;/configSections&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="2.0.0.0"/&gt;
      &lt;add key="webpages:Enabled" value="false"/&gt;
      &lt;add key="PreserveLoginUrl" value="true"/&gt;
      &lt;add key="ClientValidationEnabled" value="true"/&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true"/&gt;
      &lt;add key="vs:EnableBrowserLink" value="false"/&gt;
      &lt;add key="System" value="local"/&gt;   
      &lt;add key="TraceSwitch" value="All"/&gt;
    &lt;/appSettings&gt;
    &lt;!--
      For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
  
      The following attributes can be set on the &lt;httpRuntime&gt; tag.
        &lt;system.Web&gt;
          &lt;httpRuntime targetFramework="4.5.2" /&gt;
        &lt;/system.Web&gt;
    --&gt;
    &lt;system.web&gt;
      &lt;customErrors mode="RemoteOnly"/&gt;
      &lt;trace enabled="true" requestLimit="1000" localOnly="false"/&gt;
      &lt;compilation targetFramework="4.7.1" debug="true"&gt;
        &lt;assemblies&gt;
          &lt;!--Application Insights: add System.Runtime assembly to resolve PCL dependencies--&gt;
          &lt;add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;httpRuntime targetFramework="4.7" executionTimeout="3600"/&gt;
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Helpers"/&gt;
          &lt;add namespace="System.Web.Mvc"/&gt;
          &lt;add namespace="System.Web.Mvc.Ajax"/&gt;
          &lt;add namespace="System.Web.Mvc.Html"/&gt;
          &lt;add namespace="System.Web.Optimization"/&gt;
          &lt;add namespace="System.Web.Routing"/&gt;
          &lt;add namespace="System.Web.WebPages"/&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
      &lt;httpModules/&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
      &lt;modules/&gt;
      &lt;handlers&gt;
        &lt;remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/&gt;
        &lt;remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/&gt;
        &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0"/&gt;
        &lt;remove name="OPTIONSVerbHandler"/&gt;
        &lt;remove name="TRACEVerbHandler"/&gt;
        &lt;add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/&gt;
        &lt;add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/&gt;
        &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/&gt;
        &lt;!--&lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;--&gt;
      &lt;/handlers&gt;
      &lt;urlCompression doStaticCompression="true" doDynamicCompression="true"/&gt;
      &lt;httpCompression&gt;
        &lt;dynamicTypes&gt;
          &lt;!-- TODO Geht f??r application/json nicht und ist statt dessen ??ber CompressFilterAttribute gel??st. Sollte noch mal analysiert werden --&gt;
          &lt;add mimeType="application/json" enabled="true"/&gt;
          &lt;add mimeType="application/json; charset=utf-8" enabled="true"/&gt;
        &lt;/dynamicTypes&gt;
      &lt;/httpCompression&gt;
      &lt;staticContent&gt;
        &lt;remove fileExtension=".woff"/&gt;
        &lt;mimeMap fileExtension=".woff" mimeType="application/font-woff"/&gt;
        &lt;remove fileExtension=".woff2"/&gt;
        &lt;mimeMap fileExtension=".woff2" mimeType="font/x-woff"/&gt;
      &lt;/staticContent&gt;
      &lt;httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"/&gt;
      &lt;rewrite&gt;
        &lt;rules&gt;
          &lt;rule name="RemoveIllegalCharacters"&gt;
            &lt;match url="(.*)(&amp;quot;|%22)(.*)"/&gt;
            &lt;action type="Rewrite" url="{R:1}{R:3}"/&gt;
          &lt;/rule&gt;
          &lt;!-- Do not activate remove trailing slash rule, otherwise we have sometimes an endless redirect after login --&gt;
          &lt;!--&lt;rule name="RemoveTrailingSlashRule1" stopProcessing="true" enabled="false"&gt;
            &lt;match url="(.*)/$" /&gt;
            &lt;conditions&gt;
              &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
              &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
            &lt;/conditions&gt;
            &lt;action type="Redirect" url="{R:1}" /&gt;
          &lt;/rule&gt;--&gt;
          &lt;rule name="Remove Version from static files" stopProcessing="true"&gt;
            &lt;match url="(styles|scripts|images)/(.+);v[0-9]+\.(css|js|gif|png|jpg|ico)"/&gt;
            &lt;action type="Rewrite" url="{R:1}/{R:2}.{R:3}"/&gt;
          &lt;/rule&gt;
          &lt;rule name="EnforceLowerCase" stopProcessing="true"&gt;
            &lt;match url="[A-Z]" ignoreCase="false"/&gt;
            &lt;action type="Redirect" url="{ToLower:{URL}}"/&gt;
          &lt;/rule&gt;
        &lt;/rules&gt;
      &lt;/rewrite&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.AI.Agent.Intercept" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Protocol.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.0.40306.1554" newVersion="1.0.40306.1554"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Azure.KeyVault.Core" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Xml" publicKeyToken="b77a5c561934e089" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="StackExchange.Redis.StrongName" publicKeyToken="c219ff1ca8c2ce46" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-5.2.6.0" newVersion="5.2.6.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Protocols.OpenIdConnect" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Protocols" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="ExcelDataReader" publicKeyToken="93517dbe6a4012fa" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.4.2.0" newVersion="3.4.2.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="ExcelDataReader.DataSet" publicKeyToken="93517dbe6a4012fa" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.4.2.0" newVersion="3.4.2.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Azure.Services.AppAuthentication" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.0.3.0" newVersion="1.0.3.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.0.110.0" newVersion="1.0.110.0"/&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;entityFramework codeConfigurationType="CheckMyBus.DataAccess.MSSQL.EFConfiguration, CheckMyBus.DataAccess.MSSQL"&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v12.0"/&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    &lt;system.diagnostics&gt;
      &lt;trace autoflush="true" indentsize="0"&gt;
        &lt;listeners&gt;
          &lt;add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener"/&gt;
        &lt;/listeners&gt;
      &lt;/trace&gt;
    &lt;/system.diagnostics&gt;
  &lt;/configuration&gt;
  </code></pre>