Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 web.config transformations (TransformWebConfig target)

I am trying to write unit tests for my transformations, so I am running:

msbuild migrated-project.csproj /p:Configuration=Release /T:TransformWebConfig.

This works for a new project I create in VS2010, but doesn't in this project. I'm assuming it's because it was originally a 2008 project. I know this is supposed to run in a webplatformbuild whatever, but what I'm trying to do, is just run the transform, so I can grab the transformed web.config, and run some unit tests to make sure the right values exist.

I don't see TransformWebConfig referenced as a target in either project, so I'm not sure what I'm looking for.

like image 302
Jeff D Avatar asked Oct 26 '22 17:10

Jeff D


1 Answers

TransformWebConfig is referenced through Microsoft.WebApplication.targets, which references Microsoft.Web.Publishing.targets which contains the TransformWebConfig target you're after.

I don't know what's the problem with your project without having a look at your project file. Do you mind to attach it? Might be worth to check whether the project references the version 10 of Visual Studio WebApplication target:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />)

instead of:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
like image 69
Ben Arroyo Avatar answered Dec 12 '22 22:12

Ben Arroyo