如何在 VS 2013 中启用 IntelliSense 以进行<rewrite>在转换 .config 中? [英] How do I enable IntelliSense in VS 2013 for <rewrite> in transform .config?

查看:26
本文介绍了如何在 VS 2013 中启用 IntelliSense 以进行<rewrite>在转换 .config 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定将一些重写规则移动到我们的 web.release.config 和 web.staging.config 文件中,以保持重写规则与我们不同配置运行的环境相关.

I decided I wanted to move some rewrite rules into our web.release.config and web.staging.config files in order to keep the rewrite rules relevant to the environments our different configurations run on.

IntelliSense 不喜欢这个决定,也不会打球,因为:

IntelliSense didn't like this decision and wouldn't play ball because:

xdt:转换未声明属性"

xdt:Transform "attribute is not declared"

对于 元素.

我在这里查看了 RuslanY 的解决方案我在这个网站上考虑了几个解决方案,但没有一个解决方案在 VS 2013 和 .NET v4.5 中提供了这个特定问题的解决方案.我还研究了这里的旧 MSDN 帖子 并确保了 Schemas 属性Web.config、Web.Staging.config 和 Web.Release.config 指向正确的转换架构版本.

I looked at RuslanY's solution here and I considered several solutions on this site but none of them provided the solution to this particular problem in VS 2013 with .NET v4.5. I have also studied this old MSDN post here and ensured the Schemas property of the Web.config, Web.Staging.config and Web.Release.config are pointing at the correct transform schema version.

似乎唯一的解决方案是编辑 DotNetConfig[v].xsd 文件并添加

It seems the only solution is to edit the DotNetConfig[v].xsd files and add

<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>

到每个 元素内的每个 的末尾(和 <xs:element name="rewrite"> 的标记本身)以使它们与具有良好 IntelliSense 的其他元素保持一致.

to the end of each <xs:complexType> within each of <xs:element name="rewrite">'s elements (and <xs:element name="rewrite">'s markup itself) to bring them into line with other elements that have good IntelliSense.

在这种情况下这是正确的解决方案吗(因为这些条目不存在似乎很奇怪)?有没有更好的方法将这些条目添加到 xsd 文件中,这样它们就不会在 VS 更新时丢失(这样它们会更容易应用于 VS 安装)?

Is this the correct solution in this case (because it seems strange that these entries aren't already in existence)? Is there a better way of adding these entries to the xsd files so they won't be lost on a VS update (and so they will be easier to apply on a VS install)?

或者我应该部署其他解决方案吗?

Or is there another solution that I should be deploying?

推荐答案

正如我在我的问题中所说:似乎唯一的解决方案是编辑 DotNetConfig[v].xsd 文件并添加

As I say in my question: It seems the only solution is to edit the DotNetConfig[v].xsd files and add

<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>

到每个 元素内的每个 的末尾(和 <xs:element name="rewrite"> 的标记本身)以使它们与具有良好 IntelliSense 的其他元素保持一致.

to the end of each <xs:complexType> within each of <xs:element name="rewrite">'s elements (and <xs:element name="rewrite">'s markup itself) to bring them into line with other elements that have good IntelliSense.

这篇关于如何在 VS 2013 中启用 IntelliSense 以进行&lt;rewrite&gt;在转换 .config 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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