2

As part of a migration to Sitecore 9.1.1 we are updating our solution to not only be VS2017 compatible, but trying to take advantage of migrating away from both packages.config and the VS2015 csproj file format to the new VS2017 format.

The problem we are running into occurs when publishing the solution to a local filesystem, and it happens regardless of whether we use the built-in VS publishing, msbuild, or gulp.

The gist is, Content files are published to the correct location (i.e.:

App_Config\** -> App_Config\**
Views\** -> Views\**
js\** -> js\**
etc.

However, everything you expect to be in the bin\ folder is scattered throughout the root of the publish folder:

bin\** -> \**

The question remains, how can we get what would normally publish to bin\ to actually publish to bin\ ?

Since it seems like an OutputPath issue, and we have updated all the csproj files, we've been investigating them specifically. And since it's a Helix solution there are a lot of Feature/Foundation/Project csproj files, but more or less they all look like the following:

<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">

  <PropertyGroup>
    <TargetFramework>net471</TargetFramework>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <OutputPath>bin\</OutputPath>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <OutputPath>bin\</OutputPath>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Castle.Core" Version="4.2.1" />
    <PackageReference Include="Glass.Mapper.Sc.82.Core" Version="5.3.15" />
    <PackageReference Include="Glass.Mapper.Sc.82.Mvc" Version="5.3.15" />
    <PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.4" />
    <PackageReference Include="Microsoft.AspNet.Razor" Version="3.2.4" />
    <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
    <PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.6" />
    <PackageReference Include="Microsoft.AspNet.WebPages" Version="3.2.4" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
    <PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0.0" />
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
    <PackageReference Include="OctoPack" Version="3.6.4" />
    <PackageReference Include="Sitecore.Analytics" Version="[9.1.1]" />
    <PackageReference Include="Sitecore.Client" Version="[9.1.1]" />
    <PackageReference Include="Sitecore.Kernel" Version="[9.1.1]" />
    <PackageReference Include="Sitecore.Mvc" Version="[9.1.1]" />
    <PackageReference Include="System.Collections" Version="4.0.11" />
    <PackageReference Include="System.Collections.Concurrent" Version="4.0.12" />
    <PackageReference Include="System.ComponentModel" Version="4.0.1" />
    <PackageReference Include="System.Diagnostics.Debug" Version="4.0.11" />
    <PackageReference Include="System.Globalization" Version="4.0.11" />
    <PackageReference Include="System.Linq" Version="4.1.0" />
    <PackageReference Include="System.Linq.Expressions" Version="4.1.0" />
    <PackageReference Include="System.Reflection" Version="4.1.0" />
    <PackageReference Include="System.Resources.ResourceManager" Version="4.0.1" />
    <PackageReference Include="System.Runtime.Extensions" Version="4.1.0" />
    <PackageReference Include="System.Threading" Version="4.0.11" />
    <PackageReference Include="System.Threading.Tasks" Version="4.0.11" />
  </ItemGroup>
</Project>

Any guidance on getting this configured properly or migrating to 2017 that we may have missed would be greatly appreciated.

  • Sitecore: 9.1.1
  • Visual Studio: Community 2017 15.9.11
3
  • 1
    Instead of "bin\" , can you try giving full path in outputpath like "C:\inetpub\wwwroot\MySite\bin\"
    – S.Kazmi
    Jun 12 '19 at 5:30
  • 1
    Take a look into Sitecore Habibtat Home Platform github repo -> github.com/Sitecore/Sitecore.HabitatHome.Platform . They have nice Cake scripts to solve exactly these problems for you Jun 12 '19 at 6:04
  • We want discreet build and publish processes. One may trigger the other, but are trying to avoid building directly into the webroot @S.kazmi Jun 13 '19 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.