沒有為副檔名“.html”註冊的產生提供者

來源:互聯網
上載者:User

標籤:pager   程式   詳細   type   執行   text   ica   節點   oat   

沒有為副檔名“.html”註冊的產生提供者。可以在 machine.config 或 web.config 中的 <compilation><buildProviders> 節註冊一個。請確保所註冊的提供者具有包含值“Web”或“All”的 BuildProviderAppliesToAttribute 屬性。
說明: 執行當前 Web 請求期間,出現未處理的異常。請檢查堆疊追蹤資訊,以瞭解有關該錯誤以及代碼中導致錯誤的出處的詳細資料。
異常詳細資料: System.Web.HttpException: 沒有為副檔名“.html”註冊的產生提供者。可以在 machine.config 或 web.config 中的 <compilation><buildProviders> 節註冊一個。請確保所註冊的提供者具有包含值“Web”或“All”的 BuildProviderAppliesToAttribute 屬性。

決方法:

需要增加一項web.config 中system.web節點裡配置節點:

<compilation defaultLanguage="c#" debug="true">    <assemblies>        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies><!-- 加上此節點,保證原本就是.html類型的檔案能正常訪問 --><buildProviders><add extension=".html" type="System.Web.Compilation.PageBuildProvider" /></buildProviders>    </compilation>

  

 

        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes();
        }
        private void RegisterRoutes()
        {
            var factory = new WebServiceHostFactory();
            RouteTable.Routes.Add(new ServiceRoute("KQ", factory, typeof(WS)));
            RouteTable.Routes.Add(new ServiceRoute("OA", factory, typeof(FileList)));
            RouteTable.Routes.Add(new ServiceRoute("RG", factory, typeof(Reg)));
            RouteTable.Routes.MapPageRoute("xx", "sd", "~/no.aspx");
            RouteTable.Routes.MapPageRoute("xx3", "i", "~/test.htm");
        }

沒有為副檔名“.html”註冊的產生提供者

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.