OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.4k forks source link

Renaming files is a breaking change #16997

Closed MikeAlhayek closed 1 week ago

MikeAlhayek commented 1 week ago

In PR #16976, the SiteServiceCollectionExtensions class was renamed to ServiceCollectionExtensions, which introduced a binary breaking change.

Suppose you are using Package A from NuGet, which targets Orchard Core 2.0 and is compatible with the 2.x series. Meanwhile, your project depends on Orchard Core 2.1-previews and also includes Package A as a dependency.

In this case, you might encounter an exception like the following:

An unhandled exception was thrown by the application. System.TypeLoadException: Could not load type 'OrchardCore.DisplayManagement.Handlers.SiteServiceCollectionExtensions' from assembly 'OrchardCore.DisplayManagement, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null'.

If Package A were compiled with the 2.1-previews, this issue would not occur. However, since we have no control over external projects (like Package A in this case), renaming public types or files in minor or patch releases is not advisable, as it can introduce breaking changes for users of those dependencies.