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

Fix Newtonsoft.Json package install during DNN Upgrade. #2271

Merged
merged 2 commits into from
Sep 14, 2018

Conversation

dimarobert
Copy link
Contributor

Fixes #2121

Summary

The Config component in the manifest of Newtonsoft.Json package is not needed. The binding redirect is ensured by the AssemblyInstaller through the AddOrUpdateBindingRedirect() method call inside the InstallFile() method.
This also broke the DNN upgrade from a version prior to 9.2.0 when the web.config contained additional <codebase> assembly bindings before the one with the <bindingRedirect>.
Moreover besides that, it also updated the web.config with the binding redirect twice, in both scenarios (clean install and DNN upgrade).

The binding redirect is ensured by the AssemblyInstaller through the DotNetNuke.Services.Installer.Installers.AssemblyInstaller.AddOrUpdateBindingRedirect() method call inside the InstallFile() method.
@dnfclas
Copy link

dnfclas commented Aug 27, 2018

CLA assistant check
All CLA requirements met.

This XPath expression would find any matching <dependentAssembly> element,
whether it had a <bindingRedirect> or a <codeBase> element

For dnnsoftware#2121
@bdukes
Copy link
Contributor

bdukes commented Aug 29, 2018

@dimarobert I've pushed a change to your PR branch so that the code which updates binding redirects won't incorrectly target the codeBase elements, can you try your upgrade scenarios again and let me know if that addresses the issue regardless of the order of the elements in the web.config? Thanks!

@dimarobert
Copy link
Contributor Author

dimarobert commented Aug 31, 2018

@bdukes I ran the install again with the reversed order binding redirects and the result was:

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
    <codeBase version="8.0.0.0" href="bin\NewtonSoft.Json-8.0.0.0\Newtonsoft.Json.dll" />
</dependentAssembly>
<!--Upgraded by DotNetNuke.Newtonsoft.Json version 10.0.3 - Date: 8/31/2018 9:14:32 AM-->
<!--<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1"><assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /></dependentAssembly>-->
<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
    <bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="10.0.0.0" />
</dependentAssembly>

So now the result is the same in all three scenarios. I think we are good to go.

@ohine ohine added this to the 9.3 milestone Sep 6, 2018
@mitchelsellers mitchelsellers merged commit 3bac6b3 into dnnsoftware:development Sep 14, 2018
@dimarobert dimarobert deleted the issue/2121 branch February 12, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants