contactmatt
contactmatt

Reputation: 18600

Visual Studio 2010 - Config Transformations not working, custom build configuration not being added

I have the current problem. I want to implement "Config Transformations" to make my life easier. I currently have three build configurations in Visual Studio 2010. Debug, QA and Release. The QA build configuration's settings have been copied from the Release build configuration.

Edit: This is a web application project in c-sharp.

My website application project is one of 15 of projects in the solution I'm working in. In my website, when I right click on the web.config file to "Add Config Transformations", only the debug and release .config transformation file are added, my QA one is missing :/

I looked around and saw that there's a command line option like the follows

msbuild "C:\...project.csproj" /t:TransformWebConfig /p:Configuration=QA

But after running that, i get the following error:

"The OutputPath property is not set fro project 'project'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.

Note: Within the command, my path is correct.

I'm just trying to get all three build configurations to have their own .config transformation file. The easiest way is preferred, thank you!

Upvotes: 2

Views: 1501

Answers (1)

Taylor Bird
Taylor Bird

Reputation: 8007

Something about the QA setup hasn't provided enough info to the .csproj for msbuild to do its thing. I'd recheck your configuration setup, platform mapping, etc.

What's occuring is that in your .csproj each config/platform has a section similar to this:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

Your QA configuration either does not have that defined, or (more likely) has that defined without the <OutputPath> element. OutputPath is the how/why the build creates "debug", "release" etc folders in your bin. Without it, msbuild has no clue where to output the csc.exe created binaries (at least under the default C# build definition)

To double-check, open the .csproj file in a text file.

Hope that helps your reverse engineer the problem.

Upvotes: 3

Related Questions