leekelleher / umbraco-contentment

Contentment for Umbraco - a state of happiness and satisfaction
https://marketplace.umbraco.com/package/umbraco.community.contentment
Mozilla Public License 2.0
157 stars 72 forks source link

[v4.0] Compatibility with Umbraco v9 running .NET 6.0 #223

Closed leekelleher closed 2 years ago

leekelleher commented 2 years ago

Which Contentment version are you using?

v4.x

Which Umbraco version are you using? For example: 8.14.1 - don't just write v8

9.5.0

Bug summary

When running Umbraco v9 on .NET 6.0 and try to install Contentment v4.x, I receive the following error...

Install-Package : NU1107: Version conflict detected for Umbraco.Cms.Web.Website. Install/reference Umbraco.Cms.Web.Website 10.0.0-rc1 directly to project 
Umbraco9OnNET6 to resolve this issue. 
 Umbraco9OnNET6 -> Our.Umbraco.Community.Contentment 4.0.0-alpha002 -> Our.Umbraco.Community.Contentment.Core 4.0.0-alpha002 -> Umbraco.Cms.Web.Website (>= 10.0.0-rc1 
&& < 11.0.0) 
 Umbraco9OnNET6 -> Umbraco.Cms 9.5.0 -> Umbraco.Cms.Web.Website (= 9.5.0).
At line:1 char:1
+ Install-Package Our.Umbraco.Community.Contentment -IncludePrerelease
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'Umbraco9OnNET6'.
At line:1 char:1
+ Install-Package Our.Umbraco.Community.Contentment -IncludePrerelease
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

The reason for this is due to the NuGet Package Manager attempts to resolve the package dependency by .NET target framework first. With Contentment v4, the target for .NET 6.0 has minimum dependency on Umbraco v10. So it is unable to resolve the dependency and install the package.

Steps to reproduce

  1. Create new Umbraco Project within Visual Studio, (using Umbraco's official template), and target .NET 6.0
  2. Run the website, install Umbraco, make sure all that works first
  3. Install Contentment package from the NuGet Package Manager command line
PM> Install-Package Our.Umbraco.Community.Contentment -IncludePrerelease
  1. You should receive the NU1107: Version conflict detected error (as outlined above).

Expected result / actual result

I'd expect to run the Install-Package Our.Umbraco.Community.Contentment command and for it to "just work".


Current workarounds are to either...

  1. Use a previous version of Contentment, e.g. v3.x. As this targets Umbraco v9 on .NET 5.0, which will work on .NET 6.0
  2. or, upgrade the web-app to use Umbraco v10.

Do you have Umbraco ModelsBuilder enabled?

What browsers are you seeing the problem on?

No response

leekelleher commented 2 years ago

Related, @nathanwoulfe's blog post about his Umbraco 10 release of Plumber, and the complexities of maintaining a package that supports Umbraco 8, 9 and 10. https://nathanw.com.au/post/a-year-ending-plumber-release/

leekelleher commented 2 years ago

Given that Umbraco 10 has been released for 2 months and no one has complained to me about Umbraco 9 support on .NET 6.0, (apart from one 😕 emoji on original description above - I'm unsure what that means - feel free to reach out), I'm going to close off this ticket.

I'm happy to re-open if anyone has workable suggestions, but as they say "a rolling stone gathers no moss".