Bot Template Project fails at publishing after several times publish from VS.Net
Published Dec 18 2018 03:29 PM 1,054 Views
Microsoft

If you create a Microsoft Bot project using Bot template projects, you may run into publish failure after several times publish - could be 3 times, could be 8 times, it eventually will fail.

 

The publish error looks like below:

__________________________________________________________________________________________________________

1>------ Build started: Project: Microsoft.Bot.Sample.SimpleEchoBot, Configuration: Release Any CPU ------

1>  Microsoft.Bot.Sample.SimpleEchoBot -> C:\Users\dejue\Desktop\CustomerFiles\Cx0241\NYIT-MS-SR-1-src\bin\SimpleEchoBot.dll

2>------ Publish started: Project: Microsoft.Bot.Sample.SimpleEchoBot, Configuration: Release Any CPU ------

2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(3725,5): Warning MSB3231: Unable to remove directory "obj\Release\Package\PackageTmp". Could not find a part of the path 'C:\Users\dejue\Desktop\CustomerFiles\Cx0241\NYIT-MS-SR-1-src\obj\Release\Package\PackageTmp\obj\Release\Package\PackageTmp\obj\Release\Package\PackageTmp\obj\Release\Package\PackageTmp\packages\Microsoft.Bot.Builder.3.16.1.38846\src\Microsoft.Bot.Builder\Base'.

2>Transformed Web.config using C:\Users\dejue\Desktop\CustomerFiles\Cx0241\NYIT-MS-SR-1-src\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.

2>Auto ConnectionString Transformed obj\Release\TransformWebConfig\transformed\Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.

2>Copying all files to temporary location below for package/publish:

2>obj\Release\Package\PackageTmp.

___________________________________________________________________________________________________________

 

To address the issue, we needs to do the following:

1. Delete the obj folder under the project (back it up before delete just to be safe).

2. Modified the PostDeployScripts\IncludeSources.targets file to the following:

 

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>

    <CoreCompileDependsOn>$(CoreCompileDependsOn);IncludeSource</CoreCompileDependsOn>

  </PropertyGroup> 

  <Target Name="IncludeSource">

    <ItemGroup>

                <Content Include="**/*.cs" Exclude="obj/**" />

        <Content Include="**/*.csproj" Exclude="obj/**" />

      <Content Include="PostDeployScripts\*.*" />

    </ItemGroup>

  </Target>

</Project>

Version history
Last update:
‎Dec 18 2018 03:29 PM
Updated by: