Question

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 didn't like this decision and wouldn't play ball because:

xdt:Transform "attribute is not declared"

for the <rewrite> element.

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.

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"/>

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.

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?

Was it helpful?

Solution

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"/>

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top