views:

387

answers:

1

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.

+1  A: 

Hi Jeff,

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