A colleague asked my help with the following problem; his ASP.NET Core application failed to start. In the event viewer I noticed the following error message:
Could not load configuration. Exception message:
Unable to get required configuration section 'system.webServer/aspNetCore'. Possible reason is web.config authoring error.
Here is the related web.config file:
Did you notice what’s wrong? The web.config includes transformation tags which are not allowed in your web.config file. You should only use them in your transformation files(e.g. web.development.config). After removing the xdt references, the application started without a problem.