开发者

How do I include a web.config custom section schema without having to update each dev machine?

I've added a new custom section to the web.config of an application.

I have also created a corresponding schema file for the new section definition.

How do I include the schema reference in the web.config so that any developer editing the section has intellisense enabled when dealing with my new custom config section?

I've seen solutions whereby I include the schema reference within the web.config by having to update the [IDE installation directory]\Packages\schemas\xml location? This works开发者_StackOverflow社区 but I want to ensure that any new developer checking out the code on a fresh development machine automatically has the intellisense enabled without having to also update their development machine.


Add your .xsd file as a solution item (or project item). Visual Studio will automatically use any schema file it finds in a solution. You may have to restart Visual Studio for it to start working.

You will also need to reference the schema in the section element:

<mySection xmlns:name-of-schema>
...
</mySection>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜