dnnsoftware / Dnn.Platform

DNN (formerly DotNetNuke) is the leading open source web content management platform (CMS) in the Microsoft ecosystem.
https://dnncommunity.org/
MIT License
1.01k stars 745 forks source link

Newtonsoft.Json v13 missing in upgrade file's BIN folder #5332

Open tpperlman opened 1 year ago

tpperlman commented 1 year ago

Description of bug

We performed an upgrade of a DNN v09.09.01 site using the DNN v.09.11 upgrade file and got the following error:

Uncaught Sys.Net.WebServiceFailedException: Sys.Net.WebServiceFailedException: The server method 'GetSecurityTab' failed with the following error: System.IO.FileLoadException-- Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Steps to reproduce

Upgrade a DNN install lower than v09.09.01 using the DNN v.09.11 upgrade file.

Current behavior

The install fails due to either an outdated or missing Newtonsoft.Json.dll file in the BIN folder.

Expected behavior

The Newtonsoft.Json.dll should be included in the DNN v.09.11 upgrade file and dependencies updated.

Additional context

We had to manually update the DLL from the DNN v.09.11 install file.

If an upgrade path is to install v9.10+ prior to v9.11, it hasn't been mentioned in the release notes.

tpperlman commented 1 year ago

The following other files are also missing from the DNN v9.11 upgrade BIN folder vs. the install, not sure is there is any impact yet:

Providers/DotNetNuke.Providers.AspNetClientCapabilityProvider.dll DotNetNuke.log4net.dll DotNetNuke.Maintenance.deps.json DotNetNuke.Maintenance.dll DotNetNuke.ModulePipeline.dll DotNetNuke.Services.Syndication.dll DotNetNuke.SiteExportImport.dll DotNetNuke.Web.Client.dll

jeremy-farrance commented 1 year ago

I also noted that the Newtonsoft.Json.dll was missing from the Upgrade zip, however...

I used nvQuickSite 2.2 to install DNN 9.10.02 and then made note of the following DLLs: image

Then used the 9.11.00 Upgrade zip to upgrade the site in the usual way. As you can see, after the upgrade Newtonsoft Json and PetaPoco are both the correct new versions as expected (reading the release notes). image

So since I started at 9.10.02, there must be something about your install or the old version of DNN (you noted 9.09.x) that causes the upgrade to fail. Or maybe your upgrade process didn't finish? Have you done something as simple as restore back to 9.09.x and try the upgrade again?

Anyhow, I hope this helps. Thanks - Jeremy

mitchelsellers commented 1 year ago

It is expected that the Newtonsoft Json file ias not included, that was done as a way to prevent issues with third-party modules installing a conflicting version.

What third-party modules are you using? Do you have any custom modules that manually used a higher version of Newtonsoft?

tpperlman commented 1 year ago

Hi Folks, thank you all for the quick replies.

Our existing DNN v09.09.01 installation has a number of custom modules that have dependencies on Newtonsoft.Json:

We had Newtonsoft.Json v11.0.2 installed when the upgrade was performed. The same file and web.config assembly redirect for Newtonsoft.Json v11.0.2 were there during the upgrade, when this error appeared:

Uncaught Sys.Net.WebServiceFailedException: Sys.Net.WebServiceFailedException: The server method 'GetSecurityTab' failed with the following error: System.IO.FileLoadException-- Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

So it appears that the GetSecurityTab method in the Upgrade Wizard in DNN v.09.11.00 requires Newtonsoft.Json v13? If I remove the Newtonsoft.Json.dll from the BIN folder then I get the same error message above. Only if I manually copy Newtonsoft.Json.dll v13 from the DNN v9.11 install file can the upgrade proceed, and I also needed to update the assembly redirect to Newtonsoft.Json v13 for our custom modules.

tpperlman commented 1 year ago

As an aside, some of our custom modules also required a newer version of Microsoft.Extensions.DependencyInjection.Abstractions that is also overwritten in the DNN v09.11.00 upgrade so we had to manually upgrade that too and update the binding redirect.

tpperlman commented 1 year ago

An additional known issue we've run into upgrading other sites that could go into release notes is that Evotiva DNN Backup also needs to be updated prior to upgrading as noted in issue #5278

stale[bot] commented 1 year ago

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!