问题描述
我决定我想将一些重写规则移到我们的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:
我看着,我在此站点上考虑了几种解决方案,但是没有一个解决方案提供了.NET v4.5在VS 2013中解决此特定问题的方法。我还研究了,并确保了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:complexType> $ c的末尾每个
< xs:element name = rewrite>
元素中的$ c>(和< xs:element name =重写>
的标记本身)以使其与具有良好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:complexType> $ c的末尾每个
< xs:element name = rewrite>
元素中的$ c>(和< xs:element name =重写>
的标记本身)以使其与具有良好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中为< rewrite>启用IntelliSense。在转换。配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!