Web.Config 合成荧光笔上的 Visual Studio 2008 问题
一个奇怪的问题:我安装了 IIS (7.5) Url Rewriter 模块,以便将一些 url 重写规则应用于 Asp.Net 3.5 WebForms 应用程序。
最近,我已将这些规则移至单独的配置文件中,如此处所述 和此处。
因此,在 web.config 中,我
<rewrite>
<rules configSource="rewriteRules.config" />
</rewrite>
一切正常,项目编译并运行没有问题,但 VS xml 编辑器将属性 configSource
标记为未声明...
知道为什么吗?
A strange issue: I've installed the IIS (7.5) Url Rewriter module in order to apply some url rewrite rules to an Asp.Net 3.5 WebForms application.
Recently I've moved these rules in a separate configuration file, as explained here and here.
So in the web.config I've
<rewrite>
<rules configSource="rewriteRules.config" />
</rewrite>
All works fine, the project compiles and run with no problems, but the VS xml editor marks the attribute configSource
as undeclared...
Any idea of why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不记得 IIS 或模块本身附带了智能感知,所以我认为您正在使用一些外部包进行模式验证?
如果是这样,则在创建架构时很可能会忽略它。 configSource 是 IIS 配置模型的一项功能,因此您不需要实现它,因此您也不需要在生成 .xsd 时对其进行标记。
您需要做的就是找到提供突出显示的 .xsd 并添加
到正确的级别。
如果 VS 或模块确实附带突出显示,我对错误表述表示歉意。然而,解决这个问题的方法是完全相同的。只需找到映射重写内容的 .xsd 并为 configSource 添加一个值即可。
I don't remember intellisense shipping with either IIS or the module itself, so I'm thinking you are using some external package for schema validation?
If so, it was likely just overlooked when the schema was created. configSource is a feature of the IIS config model, so its not something you have to implement and as such not something that you'd think to label up when generating an .xsd.
All you need to do is find the .xsd providing the highlighting and add
at the right level.
If VS or the module DOES ship with the highlighting, my apologies for misstating. To fix that, however, is the exact same solution. Just find the .xsd that maps the rewrite stuff and add a value for configSource.