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 ...
随机推荐
- .net core Elasticsearch 查询更新
记录一下: 数据结构如下: public class ESUserTransaction { public long AccountId { get; set; } public string Var ...
- CAD把当前图形保为一个jpg文件(com接口Delphi语言)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 procedure TForm2.Button1Click(Sender: TObje ...
- 梦想CAD控件 2019.01.20更新
下载地址:http://www.mxdraw.com/ndetail_10120.html1. 修改CAD不等比例块保存问题2. 修改CAD捕捉时,Z值对捕捉不准的影响3. 修改图片对象选择后,自动跑 ...
- JavaScipt30(第十个案例)(主要知识点:选中一个数组中间相连部分进行操作的一种思路)
承接上文,第九个案例就不说了,是控制台的一些东西,一般用的很少,了解下就行了,想用的时候再翻api.这是第10个案例: 需要实现的效果是:点击一个checkbox,然后按下shift点击另一个chec ...
- 04Servlet的生命周期
Servlet的生命周期 Servlet运行在Servlet容器中,其生命周期由容器来管理.Servlet的生命周期通过javax.servlet.Servlet接口中的init().service( ...
- 散列--P1047 校门外的树
题目描述 某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是1米.我们可以把马路看成一个数轴,马路的一端在数轴0的位置,另一端在L的位置:数轴上的每个整数点,即0,1,2,-,L,都种有 ...
- MyBatis 中 resultMap 详解
resultMap 是 Mybatis 最强大的元素之一,它可以将查询到的复杂数据(比如查询到几个表中数据)映射到一个结果集当中.如在实际应用中,有一个表为(用户角色表),通过查询用户表信息展示页面, ...
- swiper.animate--css3翻页动画
基于swiper 的 animate动画,适用于Swiper2.x和Swiper3.x . 1. 使用Swiper Animate需要先加载swiper.animate.min.js和animate. ...
- oop设计模式抽象总结
创建型模式: 一.简单工厂,工厂方法,抽象工厂 简单工厂:只有一层抽象,由工厂去获得抽象类的具体对象,工厂内的方法可以看做静态方法 工厂方法:有两个抽象,工厂的抽象和具体类的抽象. 举个例子: 有个汽 ...
- 59.关系型与document类型数据模型对比
现假设有如下两个类: class Department(object): def __init__(self, dept_id, name, desc, employees=[]): self.dep ...