Is web.config mandatory?

web.config is required by IIS to start the PowerServer Web APIs (an ASP.NET Core application). It configures which ASP.NET Core application should be invoked and what is the hosting model for the application in the IIS server. It will be ignored when deployed to non-IIS servers.

web.config was generated by PowerServer starting from Version 2022 R2 when the Web API project was upgraded from .NET Framework to .NET Core.

If you have created your own web.config, then you should not have web.config automatically generated and deployed by PowerServer project; otherwise, the auto generated web.config file will overwrite your web.config file during deployment.

To NOT generate the web.config file with the PowerServer project deployment, you can uncheck the web.config option in the Deploy page > Advanced tab (This option is selected by default when you choose to deploy to IIS or create a package).