vnbaaij / Baaijte.Optimizely.ImageSharp.Web

Use SixLabors.ImageSharp.Web in Optimizely
Apache License 2.0
17 stars 15 forks source link

Cannot install into a CMS 12 site running version 12.11.0 #15

Closed GeekInTheNorth closed 2 years ago

GeekInTheNorth commented 2 years ago

I have a CMS 12 solution which is running at the latest version of CMS -> 12.11.0

When I try and install the Baaijte.Optimizely.ImageSharp.Web, I get a conflict error.

NU1107: Version conflict detected for EPiServer.Framework. Install/reference EPiServer.Framework 12.9.0 directly to project Cms.Web to resolve this issue. 
 Cms.Web -> Baaijte.Optimizely.ImageSharp.Web 2.1.0 -> EPiServer.CMS.Core 12.9.0 -> EPiServer.Framework (= 12.9.0) 
 Cms.Web -> EPiServer.CMS 12.11.0 -> EPiServer.Hosting 12.8.0 -> EPiServer.Framework (= 12.8.0).
GeekInTheNorth commented 2 years ago

My uses the standard EPiServer.CMS 12.11.0 and no other EPiServer packages have been manually added. I did resolve this by manually installing EPiServer.Framework and EPiServer.Framework.AspNetCore at their latest versions. This is because EPiServer.CMS 12.11.0 pulls in the lowest compatible version of EPiServer.Framework at 12.8.0 with is then a conflict for this package.

I can also install at Baaijte.Optimizely.ImageSharp.Web v2.0.0 and not have the issue.

I opted for the later as it does not require me to install any EPiServer package beyond EPiServer.CMS

GeekInTheNorth commented 2 years ago

If you update the CSPROJ for the package and replace the installed packages with the following:

  <ItemGroup>
    <Compile Remove="modules\**" />
    <EmbeddedResource Remove="modules\**" />
    <None Remove="modules\**" />
  </ItemGroup>

  <ItemGroup>
    <None Remove="$(UserProfile)\.nuget\packages\**\*.zip" />
    <None Remove="$(UserProfile)\.nuget\packages\**\*.config" />
  </ItemGroup>

  <ItemGroup>
      <PackageReference Include="EPiServer.CMS" Version="12.11.0" />
      <PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
      <PackageReference Include="SixLabors.ImageSharp.Web" Version="2.0.2" />
  </ItemGroup>

Then it will compile and remove friction from installing into other projects while also omitting the undesirable modules folder.

vnbaaij commented 2 years ago
<ItemGroup>
    <None Remove="$(UserProfile)\.nuget\packages\**\*.zip" />
    <None Remove="$(UserProfile)\.nuget\packages\**\*.config" />
  </ItemGroup>

Would would you add this? Can imagine it giving errors in automated CI/CD workflows and also, what is in there what should not be added?

vnbaaij commented 2 years ago

I've uploaded version 2.1.1 which has the changes mentioned above (with exception of the $userprofile things)

GeekInTheNorth commented 2 years ago

Those lines your questioning just mean you omit the modules folder in your packages. Unless the project in question is the web project then they are entirely surplus to requirements and are not referenced. Visual Studio doesn't handle the omission of the modules folder very well without them.

I've not encountered any issues with this in CI/CD pipelines within Azure DevOps or within GitHub Actions across several projects, but that of course doesn't rule out other build systems.

Thank you for acting so quickly on this, it was quite unexpected since there was a work around.