Thursday 19 November 2009

_PublishedWebsites missing when using MSBuild

Had some issues with msbuild this morning. The build was successful but when I looked into the drop location, there was no folder _PublishedWebsites only a list of all the bin dll's.

This was the most useful link I found which explains how to change your projects csproj file in order to force msbuild to create and dump website files and folders into the drop locations _PublishedWebsites directory. (Basically so that msbuild knows the project is a web application)

All you need to do is in the csproj file is to include this line:

<Import 
Project="
    $(MSBuildExtensionsPath)\
    Microsoft\VisualStudio\v9.0\
    WebApplications\Microsoft.WebApplication.targets" 
Condition="" />

2 comments:

Anonymous said...

Thank You! Thank You! Thank You! You have saved me hours!

Christian M said...

you can safely update that version number to 15.0 (vs2017) or 16.0 (vs2019)

The problem is still very valid.