Question

We're in the process of upgrading to vs2k12 and .net 4.5, so I'm going through our build process and getting everything working again on our CI server, but I'm having some difficulty.

Here's how things are supposed to work:

We have a solution file with two web projects in it, on a developers machine these are compiled "in place" (output is not redirected) and IIS points to the respective projects folders for development and testing, this part is fine.

On our build machine we need to redirect the output of each of the web applications (2) into separate folders to be packaged up by our installers, this is where I'm having difficulty. What's happening is one of the web projects content is ending up inside the other web projects folder, overwriting files like Global.aspx and web.config since each project has their own.

We used to use web deployment projects to accomplish this, but they are now deprecated, so I'm trying to use msbuild's web publishing mechanism/profiles, but I'm basically lost.

I've tried things mentioned here:

I must be missing something simple, as all I'm trying to do is a file system copy, no fancy schmancy publish-to-some-web-server magic.

At the moment, I'm calling msbuild on the sln file from my nant build script like this:

<msbuild project="${root.dir}\WebPortal\WebPortal ExtJS\WebPortal ExtJS.sln" verbosity="${tools.dotnet.msbuild.verbosity}">
    <property name="Configuration" value="${msbuild.configuration}" />
    <property name="OutputPath" value="${project.builddir}" />
    <property name="DeployOnBuild" value="true" />
    <property name="DeployTarget" value="PipelinePreDeployCopyAllFilesToOneFolder " />
    <property name="WebPublishMethod" value="FileSystem" />
    <property name="publishUrl" value="${project.builddir}" />
    <property name="DeleteExistingFiles" value="true" />
    <property name="DebugSymbols" value="${msbuild.debugSymbols}" />
    <property name="DebugType" value="${msbuild.debugType}" />
</msbuild>

What do I need to do to each of my web projects to get the output to redirect properly when built from the same solution file? I've thought of just setting the output folder in each csproj specifically, but that also changes where the output goes when compiled on a developers machine, which I would like to avoid if at all possible, to keep paths simpler/less confusing/cleaner.

Was it helpful?

Solution

So I got everything working, here's how I'm calling MSBuild now:

<msbuild project="${root.dir}\WebPortal\WebPortal ExtJS\WebPortal ExtJS.sln"
                 verbosity="${tools.dotnet.msbuild.verbosity}">
            <property name="Configuration" value="${msbuild.configuration}" />
            <property name="DeployDir" value="..\..\${output.dir}" />
            <property name="DeployOnBuild" value="true" />
            <property name="PublishProfile" value="BuildMachineDeployment" />
            <property name="DebugSymbols" value="${msbuild.debugSymbols}" />
            <property name="DebugType" value="${msbuild.debugType}" />
            <arg value="/m" />
        </msbuild>

Then inside the .pubxml file of my deployment profile I set this property to use the $(DeployDir) variable I created:

<publishUrl>$(DeployDir)\EmerGeo Portal</publishUrl>

Now all web projects in my solutions build and deploy to the correct folders automatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top