惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
T
Threatpost
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
D
Docker
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
T
Troy Hunt's Blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
F
Full Disclosure
B
Blog
O
OpenAI News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
Know Your Adversary
Know Your Adversary
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Recorded Future
Recorded Future
IT之家
IT之家
Project Zero
Project Zero
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - lswweb

Drone概念与答疑 Drone基于K8S的Secrets管理 Centos8通过X11使用GUI应用 Linux自己常用命令记录(待续) K8S Master节点灾备与恢复 - ETCD K8S Master节点灾备与恢复 - Host文件Copy Rook Ceph出现daemons have recently crashed异常 Ceph rbd删除image遭遇watchers异常处理 Ceph OSD更换硬盘后遭遇PG Inconsistent异常与处理 Rook Ceph OSD异常,格式化osd硬盘重新挂载 进入K8S Pod执行操作,遭遇Operation not permitted错误 K8S Pod挂载rook ceph pv报not found in the list of registered CSI drivers异常处理 Vs中调试MVC源代码步骤 手动创建vsct文件 快速查找找VS菜单信息(Guid、GuidId、CmdId等) 在多排序条件下SQL获文章上一条、下一条记录 Knockout中ViewModel与Model的互转 Asp.Net MVC 表单验证 AjaxOptions.OnSuccess回调方法返回的参数信息
一次自定义Configuration的悲惨经历。
lswweb · 2009-07-22 · via 博客园 - lswweb

     终于发现问题了。。。太不容易了。。。5555
     昨天偶然想起来把一个项目中生成静态页配置文件做成一个单独到config文件。由于以前没有接触过自定义Configuration动手前上网查一下资料,发现蛮简单的。。定义section。。。定义属性。。。ConfigurationProperty声明。很快就把结构搞定了。。
     接着配置web.config文件

Code

     然后搞了一个单独的文件 StaticPage.config (^_^应该大家已经知道我错在那里了。。。呵呵)

Code

    然后加载文件

Configuration configuration =WebConfigurationManager.OpenWebConfiguration("/StaicPages.config")

    运行。。没效果。。失败。
    找问题。。
    然后把staticPage.config文件的内容复制到web.config文件再运行。。。成功。。。
    再放到单独文件里边。。。。失败。。。
    上网查资料,发现网上相关自定义配置Configuration的文章基本上都是一个模子刻出来的一样。。跟MSDN上差不多。。。找不到答案。。而查到一些些用到WebConfigurationManager.OpenWebConfiguration的代码。。。基本上也全是一个模样。。。WebConfigurationManager.OpenWebConfiguration(“~”)
     怎么搞都不行。。。。快疯了。。。
     过了一天半,最终加载.net framework源码调试。。才发现WebConfigurationManager.OpenWebConfiguration(string path) 这个方法,path参数是一个目录的url,而不是config文件的url。指定一个目录url会自动检测读取目录下边的web.config文件。。。。

      郁闷中。。。。。。

      最终也没有得到我想要的结果。。。不过总算学了点东西