开发者

xsd schema for my ConfigurationSection

I'm d开发者_开发技巧eveloping a class library project which has it's own implementation of ConfigurationSection class. I want to provide intellisense support for configuration files. I created a valid xsd file for config section. Now the problem I have is, how to tell web.config/app.config file to use my xsd schema? I know setting xmlns attribute to the section, but this solution throws exception runtime. So is there any other way to assign configuration file my xsd schema?

And just to clear things, I will mark the correct answer and vote up the post :-)

Thanks


You'll need to add your schema to the DotNetConfig.xsd usually located at *\Program Files\Microsoft Visual Studio xxx\Xml\Schemas*

Do make a backup of the original before you proceed.

Now you'll basically just add the elements that represent your custom config stuff.


This is a really old question, but the correct answer hasn't been posted yet. There's no need to modify the DotNetConfig.xsd file.

If you right click on the config file (either in the editor or in Solution Explorer) and go to Properties, in the Properties window there's a property called Schemas.

xsd schema for my ConfigurationSection

If you click the "..." in the value field, the XML Schemas editor window will pop up and you can add your custom .xsd schema document here. Just make sure to check the "Use" column to use your xsd with that document.

xsd schema for my ConfigurationSection

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜