system.web section group下的section
private Configuration _configuration;
private ConfigurationSectionGroupCollection sectionGroups;
private SystemWebSectionGroup systemWebSectionGroup; [SetUp]
public void TestSetUp()
{
var filePath = @"/";
_configuration = WebConfigurationManager.OpenWebConfiguration(filePath, "Test");
sectionGroups = _configuration.SectionGroups;
systemWebSectionGroup= sectionGroups.Get("system.web") as SystemWebSectionGroup;
} [TearDown]
public void TestTearDown()
{
_configuration = null;
}
默认有38个section
1 System.Web.Configuration.SecurityPolicySection
2 System.Web.Configuration.AuthenticationSection
3 System.Web.Configuration.ProfileSection
4 System.Web.Configuration.AuthorizationSection
5 System.Web.Configuration.MembershipSection
6 System.Web.Configuration.AnonymousIdentificationSection
7 System.Web.Configuration.HttpCookiesSection
8 System.Web.Configuration.PagesSection
9 System.Web.UI.MobileControls.MobileControlsSection
10 System.Configuration.DefaultSection
11 System.Web.Mobile.DeviceFiltersSection
12 System.Web.Configuration.MachineKeySection
13 System.Web.Configuration.WebPartsSection
14 System.Web.Configuration.WebControlsSection
15 System.Web.Configuration.CompilationSection
16 System.Web.Configuration.HealthMonitoringSection
17 System.Web.Configuration.TraceSection
18 System.Web.Configuration.ProcessModelSection
19 System.Web.Configuration.HttpRuntimeSection
20 System.Web.Configuration.CustomErrorsSection
21 System.Web.Configuration.IdentitySection
22 System.Web.Services.Configuration.WebServicesSection
23 System.Web.Configuration.SessionPageStateSection
24 System.Web.Configuration.UrlMappingsSection
25 System.Web.Configuration.TrustSection
26 System.Web.Configuration.SessionStateSection
27 System.Web.Configuration.ClientTargetSection
28 System.Web.Configuration.HttpModulesSection
29 System.Web.Configuration.FullTrustAssembliesSection
30 System.Web.Configuration.XhtmlConformanceSection
31 System.Web.Configuration.DeploymentSection
32 System.Web.Configuration.HttpHandlersSection
33 System.Web.Configuration.HostingEnvironmentSection
34 System.Web.Configuration.PartialTrustVisibleAssembliesSection
35 System.Web.Configuration.GlobalizationSection
36 System.Web.Configuration.RoleManagerSection
37 System.Web.Configuration.SiteMapSection
38 System.Web.Configuration.ProtocolsSection
int i = ;
var temp = sectionGroups.Get("system.web");
if (temp is SystemWebSectionGroup systemWebSectionGroup)
{
foreach (var item in systemWebSectionGroup.Sections)
{
i++;
Console.WriteLine($"{i} {item}");
} }
PagesSection下面的Controls和Namespaces
tagPrefix="asp" namespace="System.Web.UI.WebControls.WebParts" assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
tagPrefix="asp" namespace="System.Web.UI.WebControls.Expressions" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
tagPrefix="asp" namespace="System.Web.DynamicData" assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
===
System
System.Collections
System.Collections.Generic
System.Collections.Specialized
System.ComponentModel.DataAnnotations
System.Configuration
System.Linq
System.Text
System.Text.RegularExpressions
System.Web
System.Web.Caching
System.Web.DynamicData
System.Web.SessionState
System.Web.Security
System.Web.Profile
System.Web.UI
System.Web.UI.WebControls
System.Web.UI.WebControls.WebParts
System.Web.UI.HtmlControls
System.Xml.Linq
var section = systemWebSectionGroup.Sections.Get("pages");
if (section is PagesSection pagesSection)
{
foreach (TagPrefixInfo item in pagesSection.Controls)
{
Console.WriteLine($"tagPrefix=\"{item.TagPrefix}\" namespace=\"{item.Namespace}\" assembly=\"{item.Assembly}\"");
}
Console.WriteLine("===");
foreach (NamespaceInfo item in pagesSection.Namespaces)
{
Console.WriteLine(item.Namespace);
}
}
system.web section group下的section的更多相关文章
- web.config add handlers and httpmodule to System.Web section.
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on how ...
- system.web下的HttpModules节点和system.webServer下的modules节点的配置区别
[转]自定义HttpModule的一些经验--配置篇 自定义web模块,需继承System.Web.IHttpModule接口 一:拦截对该服务器所有的http请求. 第一步:将自定义module类使 ...
- 在.net2.0下使用System.Web.Script.Serialization;
最近,在弄json字符串转为对象.需要添加这个引用System.Web.Script.Serialization;因为版本必须是dotnet2.0的原因,发现很多解决方案不适合自己.故使用这种解决办法 ...
- Web.config的system.webServer节点与system.web的区别
Web.config 文件中的 system.webServer 节用于指定适用于 Web 应用程序的 IIS 7.0 设置.system.WebServer 是 configuration 节的子级 ...
- 定义了重复的system.web.extensions/scripting/scriptResourceHandler怎么办
今天移转系统,都配置好之后,系统报错说我的web服务下的web.config 定义了重复的 system.web.extensions/scripting/scriptResourceHandler ...
- 从Owin到System.Web.Http.Owin的HttpMessageHandlerAdapter看适配器模式
.mytitle { background: #2B6695; color: white; font-family: "微软雅黑", "宋体", "黑 ...
- 浅从System.Web.Http.Owin的HttpMessageHandlerAdapter看适配器模式
本文版权归博客园和作者吴双本人共同所有 转载和爬虫请注明原文地址 www.cnblogs.com/tdws 一.写在前面 适配器模式(Adapter) 可用来在现有接口和不兼容的类之间进行适配.有助于 ...
- [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 [B]System.Web.WebPages.Razor.Configuration.HostSection。
记录下mvc4升级到mvc5后,运行项目提示: “/”应用程序中的服务器错误. [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转 ...
- IIS 无法读取配置节"system.web.extensions",由于它缺少节声明
作者:jiankunking 出处:http://blog.csdn.net/jiankunking 今天在本地安装iis.搭建站点,应用程序的时候报错以下的错误: server错误 Internet ...
随机推荐
- RabbitMQ系列(八)--顺序消费模式和迅速消息发送模式
MQ使用过程中,有些业务场景需要我们保证顺序消费,而如果一个Producer,一个Queue,多个Consumer的情况下是无法保证顺序的 举例: 1.业务上产生三条消息,分别是对数据的增加.修改.删 ...
- spring boot+mybatis+mysql增删改查分页
server: port: servlet: context-path: /springBootMybatis spring: datasource: name: test url: jdbc:mys ...
- 如何使用fio模拟线上环境
线上表现 这里我想通过fio来模拟线上的IO场景,那么如何模拟呢? 首先使用iostat看线上某个盘的 使用情况,这里我们需要关注的是 avgrq-sz, avgrq-qz. #iostat -dx ...
- 洛谷——P2659 美丽的序列
P2659 美丽的序列 单调栈维护区间最小值,单调递增栈维护区间最小值, 考虑当前数对答案的贡献,不断加入数,如果加入的数$>$栈顶,说明栈顶的元素对当前数所在区间是有贡献的,同时加入当前的数. ...
- HDU - 6266 - HDU 6266 Hakase and Nano (博弈论)
题意: 有两个人从N个石子堆中拿石子,其中一个人可以拿两次,第二个人只能拿一次.最后拿完的人胜利. 思路: 类型 Hakase先 Hakase后 1 W L 1 1 W W 1 1 1 (3n) L ...
- pipreqs(找当前项目依赖的包)
pipreqs pipreqs可以帮你找到当前项目的所有组件及其版本.就是当别人给你一个程序的时候,你要在自己电脑上运行起来,就需要安装程序所依赖的组件,总不能自己一个一个找吧. # 安装 pip3 ...
- VM 安装ubuntu16.04简易方法
在已经安装好VM10虚拟机后 首先文件—>新建虚拟机—>典型(标准) 选择稍后安装操作系统,后续要使用的是已经下载好的ubuntu16.04镜像 选择操作系统是linux ,版本是ub ...
- 洛谷 4251 [SCOI2015]小凸玩矩阵
[题解] 二分答案+二分图匹配. 先二分最小值Min,然后扫一遍这个矩阵,把满足a[i][j]<=Min的i,j连边,之后跑二分图匹配,如果最大匹配数大于等于n-k+1,当前的Min即是合法的. ...
- 第2章 取得大家的支持 录播感悟(意外的Sprint)
关于<取得大家的支持>这个故事我看了三遍,做了计划,做了时间轴,因为之前有过第1章<知易行难>的沟通和磨合后,相信会顺利很多吧!可是却是意外不断的发生: 1.本人车钥匙掉停车场 ...
- [UOJ48] 核聚变反应强度
QUQ 思路 求出a1的所有约数,与a1.ai放入同一数组: 求出gcd(a1,ai): 枚举约数,得出ans; 代码实现 #include<cmath> #include<cstd ...