Dnn.Platform icon indicating copy to clipboard operation
Dnn.Platform copied to clipboard

[Bug]: Clean install of 09.13.03 has incorrect Newtonsoft.Json bindingRedirect

Open puresystems opened this issue 1 year ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

Installed a clean version of DNN 09.13.03. Once logged in as Superuser, the Persona bar failed to display. Checking the browser console showed a 404 for the url /API/personaBar/localization/gettable?culture=en-US

Checking the DNN resource logs, it showed an error as per the log outputs supplied.

Steps to reproduce?

  1. Perform a clean install of DNN 09.13.03.
  2. Login and try to access Persona Bar

Current Behavior

Persona bar doesn't display

Expected Behavior

Persona bar should display to admins

Relevant log output

2024-03-13 10:09:46.080+00:00 [xxxxxxxxx][D:2][T:7][ERROR] DotNetNuke.Common.Internal.ServicesRoutingManager - Unable to register service routes
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=10.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) ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.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)

Anything else?

We updated the web.config entry and changed newVersion to 13 which resolved the issue:

Affected Versions

9.13.3 (alpha)

What browsers are you seeing the problem on?

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

puresystems avatar Mar 13 '24 11:03 puresystems

How come you are specifying an "(alpha)" version when v9.13.03 is released?

jeremy-farrance avatar Mar 13 '24 15:03 jeremy-farrance

The issue template hadn't been updated to indicate that 9.13.3 is released. @puresystems to clarify, are you using the released version of 9.13.3?

bdukes avatar Mar 13 '24 16:03 bdukes

Yes, v9.13.3.


From: Brian Dukes @.> Sent: Wednesday, March 13, 2024 4:04:32 PM To: dnnsoftware/Dnn.Platform @.> Cc: Dan Rice @.>; Mention @.> Subject: Re: [dnnsoftware/Dnn.Platform] [Bug]: Clean install of 09.13.03 has incorrect Newtonsoft.Json bindingRedirect (Issue #5997)

The issue template hadn't been updated to indicate that 9.13.3 is released. @puresystemshttps://github.com/puresystems to clarify, are you using the released version of 9.13.3?

— Reply to this email directly, view it on GitHubhttps://github.com/dnnsoftware/Dnn.Platform/issues/5997#issuecomment-1994799164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABFSBA762SPAQQBLJEAP3QDYYB2JBAVCNFSM6AAAAABET6GM3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJUG44TSMJWGQ. You are receiving this because you were mentioned.Message ID: @.***>

puresystems avatar Mar 13 '24 16:03 puresystems

Okay, two questions. 1) can you confirm ONLY DNN is installed? No settings changes? No modules (or skins or libraries, etc) installed? 2) Can you give a quick overview of your hosting env? (make/model/version of OS, web services, SQL, etc)

jeremy-farrance avatar Mar 13 '24 16:03 jeremy-farrance

To verify this, I did a fresh install of just DNN v9.13.03, and as you can see in the screenshot below, the web.config and the DLL match correctly for v13 of NewtonSoft.

But, out of the box, DNN is throwing that error (reported above) in /Portals/_default/Logs/2024.03.13.log.resources right away. So since the binding redirect is correct out of the box, the ServicesRoutingManager somehow seems to still have a Newtonsoft v10 dependency.

Logged in as a SuperUser, the PersonaBar works fine.

Then, I created a new test user, added the Administrator Role and logged in. The PersonaBar also worked fine. So I cannot reproduce that part of the issue. I also checked the DevTools console. Used a few tools in the PersonaBar and everything worked fine, no console errors either.

And finally, logged out, logged back in as SuperUser. Did Settings/Restart Application. Reloaded /Portals/_default/Logs/2024.03.13.log.resources and there are still only the original 2 occurrences of the ServicesRoutingManager error. Even with a full restart, the error does NOT recur.

image

jeremy-farrance avatar Mar 13 '24 22:03 jeremy-farrance

@jeremy-farrance was the logged error ONLY when it was initially running? Now that we upgrade with a package I wonder if it wasn't from the install process that it threw the warning and then not an issue after it was running?

mitchelsellers avatar Mar 19 '24 18:03 mitchelsellers

@mitchelsellers - What you are saying makes sense, I think I understand that certain parts of DNN may get installed - and then upgraded - as the various .resources files are processed. SO, I am not sure whether or not there is something there that needs to be addressed. But I definitely see the error thrown 2 times on every DNN deploy. But is no longer being thrown after the installation is complete and everything is functional.

@puresystems - So at this point, I've proven that the web.config binding for Newtonsoft matches the DLL in the Bin folder. See screenshot above. But I have found no way to duplicate the issue you reported: "the Persona bar failed to display." Can you provide details or steps that would allow someone to make that part of the issue happen?

Also, maybe update the Issue's Title (above) since I am pretty confident that what the Title says, is not true.

jeremy-farrance avatar Mar 19 '24 23:03 jeremy-farrance

@jeremy-farrance Just to triple confirm, AFTER install though, you never see it again?

mitchelsellers avatar Mar 20 '24 03:03 mitchelsellers

Yes. After two complete local installs using nvQuickSITE and the details described above, I "see the error thrown 2 times on every DNN deploy. But is no longer being thrown after the installation is complete and everything is functional."

The error does not appear again on the running site.

jeremy-farrance avatar Mar 20 '24 03:03 jeremy-farrance

We've not been able to repeat the issue with the persona bar from carrying out several clean installs, just the initial error logged but nothing further. @jeremy-farrance feel free to update the title to whatever you feel appropriate.

puresystems avatar Mar 20 '24 09:03 puresystems

I can reproduce and see the errors in log files with a 9.13.3 fresh install, trying to analyze the root cause.

zyhfish avatar Mar 20 '24 14:03 zyhfish