Am confused about web.config in .NET Core

前端 未结 3 1131
陌清茗
陌清茗 2021-02-12 22:47

There are a bunch of contradictory statements about web.config and .NET Core.

  • Places saying it\'s gone.
    • https://dotnetcore.show/episode-10-configuration-
3条回答
  •  耶瑟儿~
    2021-02-12 23:20

    Read a few web.config examples from Google and you should notice that,

    1. ASP.NET/WCF 2.x/4.x uses it to store configuration (tags like ).
    2. IIS uses it to store configuration (tags like ).

    So migrating to ASP.NET Core only make the first obsolete, and you should only say goodbye to that piece of knowledge.

    If you host your web app on IIS, then web.config is still needed, as you need initial settings there to configure ASP.NET Core module for IIS/IIS Express (dotnet publish generates such a file if you don't have your own).

提交回复
热议问题