Monday, 5 December 2011

Visual Studio 2010 web deployment projects do not remote the App_Data folder

Having come accross the problem before that Visual Studio 2010 web deployment projects do not remote the App_Data folder even though you have checked the box to do exactly that I have today found myself trying to find what the resolution was again so thought I would blog about it partially for your benefit but also for my own sanity should I need this information again.

Open the file
C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets

Locate the following section and add in the missing red backslash

        <!--
        Removing APP_DATA is done here so that the output groups reflect the fact that App_data is
        not present
        -->
        <RemoveDir Condition="'$(DeleteAppDataFolder)' == 'true'" Directories="$(TempBuildDir)\App_Data"/>
        <CreateItem Include="$(TempBuildDir)\**\*.*"  Condition="'$(UseMerge)' != 'true'">
            <Output ItemName="PrecompiledOutput" TaskParameter="Include" />
        </CreateItem>

No comments:

Post a Comment