transform Views\web.config only on mvc 3 / .net 4 (razor)

May 13, 2011 at 1:21 PM

My package needs to add 2 namespaces like this:   (in Views\web.config)

  <system.web.webPages.razor>

       <namespaces>

        <add namespace="mynamespace" />       

        <add namespace="mynamespace.something" />

but my package can also be used with .net 3.5 mvc 2,

and there's no system.web.webPages.razor in .net 3.5 mvc 2

so is it possible to do the transform only for .net 4 ?

Coordinator
May 13, 2011 at 3:34 PM

There’s no way to do that today. How would you want to specify that (aka, help us spec the feature)?

Phil

From: o [email removed]
Sent: Friday, May 13, 2011 6:22 AM
To: Phil Haack
Subject: transform Views\web.config only on mvc 3 / .net 4 (razor) [nuget:257521]

From: o

My package needs to add 2 namespaces like this: (in Views\web.config)

<system.web.webPages.razor>

<namespaces>

<add namespace="mynamespace" />

<add namespace="mynamespace.something" />

but my package can also be used with .net 3.5 mvc 2,

and there's no system.web.webPages.razor in .net 3.5 mvc 2

so is it possible to do the transform only for .net 4 ?

May 13, 2011 at 3:55 PM
Phil, isn't this the feature Dfowler is working on, framework specific content folders?

Sent from either Windows Phone or iPhone. You don't know.

From: Haacked
Sent: Friday, May 13, 2011 8:35 AM
To: Luan Nguyen
Subject: Re: transform Views\web.config only on mvc 3 / .net 4 (razor) [nuget:257521]

From: Haacked

There’s no way to do that today. How would you want to specify that (aka, help us spec the feature)?

Phil

From: o [email removed]
Sent: Friday, May 13, 2011 6:22 AM
To: Phil Haack
Subject: transform Views\web.config only on mvc 3 / .net 4 (razor) [nuget:257521]

From: o

My package needs to add 2 namespaces like this: (in Views\web.config)

<system.web.webPages.razor>

<namespaces>

<add namespace="mynamespace" />

<add namespace="mynamespace.something" />

but my package can also be used with .net 3.5 mvc 2,

and there's no system.web.webPages.razor in .net 3.5 mvc 2

so is it possible to do the transform only for .net 4 ?

Coordinator
May 13, 2011 at 3:56 PM

Oh yeah! I forgot that config transforms are in content folders so this would just work as part of that change. J