Closed enfJoao closed 5 days ago
In #4755 there was a discussion about .NET assemblies changing locations in .NET 9. The following report provides a comparison of assemblies in .NET 8 vs .NET 9:
Sorry. Not sure what to do with this info. Check each one of the 100 files?
Sorry... I should have provided more context. Basically the report shows that there are a LOT of assemblies which changed locations in .NET 9. However I have upgraded ~10 installations to Oqtane 6.0 at this point and I have not encountered any difficulties. These installations do include custom modules - and I have not experienced any issues with any of them. Now, 2SXC is a very large, sophisticated module - and likely has more dependencies than even the Oqtane framework itself, so this may be why it is having some upgrade challenges. But I am not sure what the Oqtane framework can realistically do to prevent these types of upgrade issues in custom modules?
When Oqtane 5.0 was released on .NET 8 there was a problem with some legacy Oqtane assemblies which were not removed and some upgrade logic was added to remove them:
try
{
// delete legacy Views assemblies which will cause startup errors due to missing HostModel
// note that the following files will be deleted however the framework has already started up so a restart will be required
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var filepath = Path.Combine(binFolder, "Oqtane.Server.Views.dll");
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
filepath = Path.Combine(binFolder, "Oqtane.Server.Views.pdb");
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
}
catch (Exception ex)
{
// error deleting file
Debug.WriteLine($"Oqtane Error: Error In 5.1.0 Upgrade Logic - {ex}");
}
This seemed to address the problem for some people. It works as long as the framework is actually able to start up and reach the upgrade code to execute it. The user experience is still not great as an error is still displayed to the user in the browser, but when they manually restart the app it will no longer encounter the error.
Sorry, but I don't see how this is related to 2sxc... If you check the latest Oqtane 5 release, it has the System.Text.Json.dll (v8) on the root folder. When I updated to Oqtane 6, it placed a new System.Text.Json.dll (v9) on the refs folder, without deleting the old one. Is this not something that could have been prevented? Even now, is there any way to quickly check if I still have other duplicated libraries?
List of files moved from /bin to /bin/refs in .NET 9:
Microsoft.AspNetCore.Authorization.dll Microsoft.AspNetCore.Components.Authorization.dll Microsoft.AspNetCore.Components.dll Microsoft.AspNetCore.Components.Forms.dll Microsoft.AspNetCore.Components.Web.dll Microsoft.AspNetCore.Cryptography.Internal.dll Microsoft.AspNetCore.Cryptography.KeyDerivation.dll Microsoft.AspNetCore.Metadata.dll Microsoft.Extensions.Caching.Memory.dll Microsoft.Extensions.Configuration.Binder.dll Microsoft.Extensions.Configuration.FileExtensions.dll Microsoft.Extensions.Configuration.Json.dll Microsoft.Extensions.DependencyInjection.Abstractions.dll Microsoft.Extensions.DependencyInjection.dll Microsoft.Extensions.Diagnostics.Abstractions.dll Microsoft.Extensions.Diagnostics.dll Microsoft.Extensions.Http.dll Microsoft.Extensions.Identity.Core.dll Microsoft.Extensions.Identity.Stores.dll Microsoft.Extensions.Localization.Abstractions.dll Microsoft.Extensions.Localization.dll Microsoft.Extensions.Logging.Abstractions.dll Microsoft.Extensions.Logging.dll Microsoft.JSInterop.dll System.Text.Json.dll
List of files removed completely in .NET 9:
System.Runtime.Caching.dll
Anomalies:
Microsoft.Extensions.Options.dll
assembly existed in multiple locations in .NET 8 /bin = 64,776 bytes /bin/refs folder = 31,496 bytes
assembly exists in only 1 location in .NET 9 /bin/refs folder = 31,512 bytes
My install refuses to start without System.Runtime.Caching.dll HTTP Error 500.30 - ASP.NET Core app failed to start
Everything else was deleted with no issues.
Does your Oqtane install have any 3rd party modules? If so, then it is likely that it is a 3rd party module which has a dependency on System.Runtime.Caching.dll - which is causing the ASP.NET Core exception (as Oqtane itself has no dependency on that assembly)
Checking with @iJungleboy
While waiting, and regarding this same topic, please bear in mind that as Oqtane progresses development, and I hope it does, more people with no skills whatsoever in programming and coding languages will start experimenting with it. So no Git sync, no VS, just the releases and updates from this git page.
If it works and keeps working, Oqtane will remain a viable option for these "administrators". It they keep hitting the "dev only" aproach, they will loop for one of the many popular alternatives.
2sxc does rely on it. Thanks for the feedback and help on managing these libraries.
@enfJoao #4858 cleans up assemblies which have been relocated in .NET 9
Oqtane Info
Version - 6 Render Mode - Static Interactivity - Server Database - SQL Server
Describe the bug
Oqtane had a System.Text.Json.dll in the root folder. Upgrading to Oqtane 6.0 places a new one in /refs/, but leaves the old one behind, causing issues such as https://github.com/2sic/2sxc/issues/3510
The update needs to remove these old libraries to prevent this issues.