views:

64

answers:

1

Hi, I have a misunderstanding with MSBuild. I want to build a web application (with a traditional .csproj project file) and get the "entire output" of the build in a new, clean output folder - including all the website files that are included in the project with <Content Include="....

The AspNetCompiler utility makes this easy for "web site" style projects - you specify the input folder and the output folder, and they can be entirely different.

So far I've only had success specifying the OutoutPath folder, i.e. moving the bin folder - but this only gives me the binaries and ignores aspx, image files, etc.

I must be missing something obvious, or fundamental! Thanks indeed.

A: 

I finally found a couple of relatively obscure references to this issue on the web.

I found I could set the (apparently undocumented!) property WebProjectOutputDir along with the standard OutputPath property, like so:

<MSBuild
    Projects="..."
    Properties="WebProjectOutputDir=D:\Output;OutputPath=D:\Output\bin"
    />

I guess this property is used in Microsoft.WebApplication.targets or somewhere. If anyone could enlighten me further about this, I'd be very grateful!

Pete Montgomery