3

I've installed the Sitecore Helix Visual Studio Templates from Anders Laub (laub plus co) and created an empty Helix project running Visual Studio 2017 in Administrator mode.

Once I add a new Project, I noticed that:

1 - Visual Studio complains about missing Unicorn config files as if they were deleted

2 - When I build the solution I get error for missing Sitecore assemblies

enter image description here

The Helix Templates were also installed running Visual Studio 2017 as administrator.

enter image description here

1 Answer 1

5

You are getting these errors because the default templates that are installed contain some errors.

Sitecore References Fix:

In your folder where you installed the templates, find all the files called $modulenamespace$.csproj. In those files you will find these lines:

<Reference Include="Sitecore.Kernel, Version=10.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Sitecore.Kernel.NoReferences.8.2.161115\lib\NET452\Sitecore.Kernel.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Sitecore.Mvc, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Sitecore.Mvc.NoReferences.8.2.161115\lib\NET452\Sitecore.Mvc.dll</HintPath>
  <Private>True</Private>
</Reference>

Notice that the package version is hard coded here. This should be changed to $sitecoreVersion$ like this:

<Reference Include="Sitecore.Kernel, Version=10.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Sitecore.Kernel.NoReferences.$sitecoreVersion$\lib\NET452\Sitecore.Kernel.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Sitecore.Mvc, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Sitecore.Mvc.NoReferences.$sitecoreVersion$\lib\NET452\Sitecore.Mvc.dll</HintPath>
  <Private>True</Private>
</Reference>

Config Files Fix:

In the project module templates, it is referencing the config files correctly in the .csproj file, but on disk they are in the wrong place - see this image:

Wrong Folder Name

If you just rename that Feature folder to Project it will work and pick up your config files correctly.

I have a PR waiting to get merged for it https://github.com/LaubPlusCo/LaubPlusCo.Helix.VsTemplates/pull/2

4
  • Thanks, mate. It just fixed my issue. Have you noticed any issue having this extension enabled? Once I have it enabled, sometimes VS IDE breaks randomly and it restarts. It happens when I open a new solution for example or when I copy and paste something while with the "add new Helix project dialog" opened.
    – João Neto
    Commented Sep 19, 2017 at 15:27
  • I haven't noticed any issues with it yet. I have been using it on a couple of projects. Definitely makes life easier :)
    – Richard Seal
    Commented Sep 19, 2017 at 15:28
  • One minute ago, Visual Studio 2017 just crashed and had to be restarted. =/
    – João Neto
    Commented Sep 19, 2017 at 15:37
  • Check your Application log in the event viewer. That might give you an idea as to what is causing it.
    – Richard Seal
    Commented Sep 19, 2017 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.