{"id":557,"date":"2017-10-10T18:58:20","date_gmt":"2017-10-10T18:58:20","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=557"},"modified":"2026-04-02T10:14:54","modified_gmt":"2026-04-02T10:14:54","slug":"asp-net-error-there-is-no-build-provider-registered-for-the-extension-html","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/asp-net-error-there-is-no-build-provider-registered-for-the-extension-html\/","title":{"rendered":"Asp.Net Error: There is no build provider registered for the extension &#8216;.html&#8217;"},"content":{"rendered":"<p>When you try to map an html file in ASP.net and rewrite the URL to remove .html extension such as the example below<\/p>\n<pre class=\"lang:default decode:true\">routes.MapPageRoute(\"myhtml\", \"myhtml\", \"~\/Resources\/demo\/myhtml.html\");\r\n<\/pre>\n<p>It throws an error as following<\/p>\n<blockquote><p>There is no build provider registered for the extension &#8216;.html&#8217;. You can register one in the &lt;compilation&gt;&lt;buildProviders&gt; section in machine.config or web.config<\/p><\/blockquote>\n<p>The following configuration changes in web.config fixes it.<\/p>\n<pre class=\"lang:default decode:true \">    &lt;compilation debug=\"true\" targetFramework=\"4.5\" &gt;\r\n      &lt;buildProviders &gt;\r\n        &lt;add extension=\".htm\" type=\"System.Web.Compilation.PageBuildProvider\"  \/&gt;\r\n        &lt;add extension=\".html\" type=\"System.Web.Compilation.PageBuildProvider\"\/&gt;\r\n      &lt;\/buildProviders&gt; \r\n    &lt;\/compilation&gt;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you try to map an html file in ASP.net and rewrite the URL to remove .html extension such as the example below routes.MapPageRoute(&#8220;myhtml&#8221;, &#8220;myhtml&#8221;, &#8220;~\/Resources\/demo\/myhtml.html&#8221;); It throws an error as following There is no build provider registered for the extension &#8216;.html&#8217;. You can register one in the &lt;compilation&gt;&lt;buildProviders&gt; section in machine.config or web.config The following configuration changes in web.config fixes it. &lt;compilation debug=&#8221;true&#8221; targetFramework=&#8221;4.5&#8243; &gt; &lt;buildProviders &gt; &lt;add extension=&#8221;.htm&#8221; type=&#8221;System.Web.Compilation.PageBuildProvider&#8221; \/&gt; &lt;add extension=&#8221;.html&#8221; type=&#8221;System.Web.Compilation.PageBuildProvider&#8221;\/&gt; &lt;\/buildProviders&gt; &lt;\/compilation&gt; &nbsp;<\/p>\n","protected":false},"author":5,"featured_media":1540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,14],"tags":[],"class_list":["post-557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net","category-how-to"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=557"}],"version-history":[{"count":2,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/557\/revisions"}],"predecessor-version":[{"id":559,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/557\/revisions\/559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1540"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}