文章摘要:There is no build provider registered for the extension '.html'. You can register one in the
.net 解决伪静态下,html页面无法访问
发布时间:2023-07-04 作者:小沈子 分类: C#
错误信息:
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'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: 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'.
解决方案:
1、在<system.webServer>节点下添加:
<handlers> <add name="GreenHandlers" verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add name="MobileHandlers" verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> </handlers>
2、在<compilation debug="true">节点下添加:
<!--URL重写文件设置开始--> <buildProviders> <add extension=".html" type="System.Web.Compilation.PageBuildProvider" /> </buildProviders> <!--URL重写文件设置结束-->
点击排行
标签云
-
C#
seo
SQLserver
IIS
.NET
SSL
程序员
VS
编程语言
https
微信小程序
jQuery
服务器
个人博客
网站关键词排名
301
.net8
http
KOL
C#集合
.NET框架
命名空间
面向对象编程
异常处理
异步编程
设计模式
编程学习网站
百度分享js
关键词研究工具
网页加载速度
外部链接优化
异步加载
snv
腾讯元器
AI智能体
C#接口
装潢设计
响应式
自动备份
个人网站
WPF
数据库优化
winform
UI
编程
Ngrok
内网穿透
开源框架
NanUI
网站
清明节
html
生成img
nginx
签到
2023跨年
快捷方式
标签打印
icon图标
博客模板
Web前端框架
JavaScript
TortoiseSVN
VS2019
数据库自动同步工具
Serv-U
.NETCore
微信接口
数组去重
404页面
保存图片
QQ
幸福
鸡汤
小沈子
超实用工具箱
Layui
51劳动节
C#面试题
疫情
数据库
Queue队列
网页
挖呀挖