我怎样包括无需更新每个开发机器一个web.config自定义栏目架构? [英] How do I include a web.config custom section schema without having to update each dev machine?

查看:100
本文介绍了我怎样包括无需更新每个开发机器一个web.config自定义栏目架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个新的自定义部分应用程序的web.config文件。

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.

我如何包括在web.config的模式引用,以便和我的新的自定义配置部分打交道时,任何开发人员编辑部分已启用智能感知?

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?

我见过的解决方案,由此我包括无需更新[IDE安装目录] \\包\\架构\\ XML的位置在web.config中的架构参考?这工作,但我想,以确保任何新的开发者检查出一个新的开发机器上的code自动拥有,而不必同时更新自己的开发机器启用智能感知。

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 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.

推荐答案

添加您的.xsd文件作为解决方案的项目(或项目项)。 Visual Studio将自动使用它找到一个解决方案的架构文件。您可能需要重新启动Visual Studio为它开始工作。

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>

这篇关于我怎样包括无需更新每个开发机器一个web.config自定义栏目架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆