1

I'm using msbuild 3.5, visual studio 2008, and web deployment projects.

I enabled webconfig replacement option for the web deployment project.

I thought I could do something like the following in the build script by appending another ItemGroup for release?

<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <WebConfigReplacementFiles Include="webDebug.config">
        <Section>connectionStrings</Section>
    </WebConfigReplacementFiles>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    <WebConfigReplacementFiles Include="webRelease.config">
        <Section>connectionStrings</Section>
    </WebConfigReplacementFiles>
</ItemGroup>
<Import Project

I do the following just fine:

msbuild myProject.wdproj

and whatever I have for the Include attribute, whether it be webDebug or webRelease it will work for the Debug version.

How do I do the same for the Release version?

I tried the following:

msbuild myProj.wdproj /p:Configuration=Release

but the connection string is never replaced properly.

What can I try next?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.