Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
puresystems opened this issue Mar 13, 2024 · 11 comments
Open
2 tasks done

Comments

@puresystems
Copy link

Is there an existing issue for this?

  • 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

  • I agree to follow this project's Code of Conduct
@jeremy-farrance
Copy link
Contributor

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

@bdukes
Copy link
Contributor

bdukes commented Mar 13, 2024

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?

@puresystems
Copy link
Author

puresystems commented Mar 13, 2024 via email

@jeremy-farrance
Copy link
Contributor

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
Copy link
Contributor

jeremy-farrance commented Mar 13, 2024

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

@mitchelsellers
Copy link
Contributor

@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?

@jeremy-farrance
Copy link
Contributor

jeremy-farrance commented Mar 19, 2024

@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.

@mitchelsellers
Copy link
Contributor

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

@jeremy-farrance
Copy link
Contributor

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.

@puresystems
Copy link
Author

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.

@zyhfish
Copy link
Contributor

zyhfish commented Mar 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants