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>

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.