Visual Studio 2017 Publish + FileSystem + Create Empty Folder

  • Thread starter Thread starter Spunny
  • Start date Start date
S

Spunny

Guest
Hi,

Hope this is right group. We publish ASP.NET web application using 'Publish'. We chose FileSystem option. This do not copy 'Empty folder'. We need this folder to be created. 2 options I am seeing.

1. Manually create folder on server

2. Create dummy file in a folder and publish

Both works, but we do not want to do it. When I searched, I see below code for MSBuild option by editing .pubxml fie

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit How to: Edit Deployment Settings in Publish Profile (.pubxml) Files and the .wpp.targets File in Visual Studio Web Projects.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AfterAddIisSettingAndFileContentsToSourceManifest>CreateEmptyFolders</AfterAddIisSettingAndFileContentsToSourceManifest>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<publishUrl>\\clientportal-dev\CPDev$</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
<Target Name="CreateEmptyFolders">
<Message Text="Adding empty folder to hold Files" />
<MakeDir Directories="$(_MSDeployDirPath_FullPath)\CustomReports"/>
</Target>
</Project>

After adding this, I rebuilt project in release mode and published. Nothing is working.

Please suggest if anyone know.


Thanks,

Continue reading...
 
Back
Top