为什么我的IIS停止提供.html页面?

我突然在我的服务器上出现一个奇怪的IIS错误:

There is no build provider registered for the extension '.html'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. 

自从什么时候.html需要一个生成提供商? 我没有触及任何生成提供程序或处理程序映射。 没有触及.NET config目录中的默认web.config或machine.config。

Web服务器如何忘记如何提供HTML? 🙁

添加到你的web.config:

 <buildProviders> <add extension=".html" type="System.Web.Compilation.PageBuildProvider" /> </buildProviders> 

当您尝试使用BuildManager从路由处理程序(或其他地方)返回html页面时,会出现此错误。 至less在我的情况下是这样的。