-
Notifications
You must be signed in to change notification settings - Fork 753
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
NewtonSoft #2121
Comments
Can I confirm that this is an issue with 9.2.0? |
That's correct, specifically the upgrade zip
…On Thu, 14 Jun 2018, 13:57 Mitchel Sellers, ***@***.***> wrote:
Can I confirm that this is an issue with 9.2.0?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2121 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHGCavH8BfkBkAPgfX9idWpzj42p-NAKks5t8l3VgaJpZM4Un0Iu>
.
|
It appears the install zip contains The upgrade zip only contains I won't be able to test this right now, as I don't have that much time at the moment. I'm guessing however that the installer/upgrader won't function on the older version of Newtonsoft.Json.dll from the previous version they are attempting to upgrade. Also, in PR #1837 the Dnn.Platform/Website/Providers/DataProviders/SqlDataProvider/09.02.00.SqlDataProvider Lines 107 to 118 in 482c35c
I believe if this is updated before the It looks like we need to either back out the changes to the web.config and assembly tables and handle all of that with the extension package for newtonsoft. Or remove the extension package and just include the binary in the bin directory directly and bump the assembly in the platform. It's weird right now we have a mix of both. Any idea why this was done this way? @ashishpd @zyhfish @tpluscode |
We need to assembly to be installed via installer, rather than included in the I think you're right, @ohine, that updating the |
@bdukes how do you think we should solve this since v09.02.00 already updated the assembly table? Also anyone else from @dnnsoftware/tag feel free to brainstorm as well. We only have a couple days before the codefreeze and it would be nice if we could get this item resolved before friday. |
The simple solution is to set the version to 10.0.2 via the 9.2.1 SQL script, if it's already 10.0.3, but that's going to require some good documentation to avoid confusing folks looking back on it. That said, I don't have any other solutions that I like better. Maybe we could run some code in |
@ohine We're on the wrong trail here. The change you highlight was removed during testing (1829d18) and is not part of the 9.2.0 package I don't see this issue doing an upgrade from a plain 9.1.1 site to 9.2.0, and looking at the errors on https://www.dnnsoftware.com/forums/forumid/200/threadid/542050/scope/posts it looks like Newtonsoft is just one part of it. I've tracked down the issue that caused them to install it this way: DNN-10226, but I'm not sure how this was handled with earlier Newtonsoft upgrades. I know DnnSharp includes their own version of Newtonsoft, using the |
@bdukes Thanks for taking the time to dig into this one a bit more. It sounds like we need to do some testing with DnnSharp next and work on reproducing the issue to see what we can do. I can get this into my schedule for the 9.3 release, I highly doubt I'd have the time for 9.2.2. If anyone else from @dnnsoftware/tag has a few extra cycles, it would be helpful to try and get this resolved in 9.2.2 if at all possible. |
@bdukes, @ohine I'm not sure if my issue is related in any way since I haven't made it to the 9.2 update yet. I am currently on DNN 8.0.3, I updated to 8.0.4 in order to install the DnnSharp Search Boost update. Once I installed the DnnSharp update all of my ajax calls are broken. I did submit a ticket with DnnSharp but haven't heard back from them. As a side note. If I update my site from 8.0.3 to 9.2 without the Search Boost update I have no issues with any of my ajax calls, just Search Boost errors out as expected. |
In my case: Upgrading from 9.1.1 tot 9.2.1 with the latest and greatest from DNNSharp results in an error installing the NewtonSoft 1.0.3. module. I had to manually copy the new dll to the bin\NewtonSoft.Json-8.0.0.0 directory and change the directive in the web.config. When installing ActionForm (5.0.155, latest at this time) it will add the following to the web.config: < dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1"> when upgrading DNN911 to 921 it results in a incompatibility |
@bdukes @ohine
The installer executes the Assembly component installer that copies the newtonsoft.json.dll version 10.0.3 in bin folder and then calls The issue with DnnSharp's In a clean DNN pre 9.2.0 the <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly> When installing any DnnSharp module the <dependentAssembly>
<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" />
<codeBase version="8.0.0.0" href="bin\NewtonSoft.Json-8.0.0.0\Newtonsoft.Json.dll" />
</dependentAssembly> After the AssemblyInstaller is executed the <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>
...
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="10.0.0.0" />
</dependentAssembly> Now it is ConfigInstaller turn to update the SolutionI can think of two solutions:
I am willing to submit a pull request with what you think would be the best solution. Please let me know what your thoughts are on the matter. |
Thanks for digging into this more @dimarobert! I definitely think DNN should be able to handle the Regarding your proposed fixes, would it work to just remove the Config component from the Newtonsoft package, since the platform is already adding the redirect correctly? Is there any reason it needs to be in both places? If there's a reason to target the redirect via XmlMerge, I think strengthening the XPath is the right solution. |
@bdukes For the upgrade scenario, it should be just fine if we remove the Config component. I will have to do a clean install of DNN 9.2.1 to see if there could be issues there. From an initial check I see that there is a <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly> Also there is a Newtonsoft module zip in the EDIT: Also what is the reason for choosing that version (Version.Max)? What happens if someone needs version 11 of newtonsoft? |
Some remarks:
There now are two rebinding rules as mentioned by @dimarobert:
Removing the following assemblybinding: should result in the use of the first, however the site still crashes. I assume DNN requires Newtonsoft.Json version 10. Thus we got at least two issues:
|
@schotman the entry that DnnSharp uses (with the Both entries should be able to live side-by-side, the issue appears to be related to an error that happens during upgrade because the update tries to change the |
@dimarobert the thought behind the version range used is that any component which is expecting to use Newtonsoft.Json (or any other strong-named assembly) should be able to use the installed version (i.e. the version of the file in the The alternative would be that .NET just refuses to run the code, because Newtonsoft.Json 10 is in the |
@bdukes I ran a debug session on a clean install. Both the Newtonsoft upgrade step and the InstallExtensionsStep in the clean install calls the <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<!--Upgraded by DotNetNuke.Newtonsoft.Json version 10.0.3 - Date: 8/27/2018 8:33:54 PM-->
<!--<bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="10.0.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />-->
<bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="10.0.0.0" />
</dependentAssembly> In both cases the bindingRedirect is updated twice. So I think that removing the Config component could be a solution. Can you think of any other scenario for the Newtonsoft.Json zip installation? |
Nothing comes to mind, I think that's the right path forward. |
@bdukes I've come up with another situation. If the web.config is initially in this state (in opposite order - I don't know if it could get in this state with normal use): <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>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly> After the installation of the modified Newtonsoft.Json package (without the Config component) the web.config looks like this: <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<!--Upgraded by DotNetNuke.Newtonsoft.Json version 10.0.3 - Date: 8/28/2018 11:55:01 PM-->
<!--<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1"><assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /><codeBase version="8.0.0.0" href="bin\NewtonSoft.Json-8.0.0.0\Newtonsoft.Json.dll" /></dependentAssembly>-->
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="10.0.0.0" />
</dependentAssembly>
<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> The upgrade process completed without any issue, but do you think that this could be an issue in the future? |
This XPath expression would find any matching <dependentAssembly> element, whether it had a <bindingRedirect> or a <codeBase> element For dnnsoftware#2121
@dimarobert I don't think that'll cause any major issues, but we should be able to resolve the ambiguity and fix this issue for good. I've pushed a change to your PR which I believe should do that. |
Kinda lost here...I just upgraded a small site from 804 to 922. I figured this issue would be solved in 922. But unfortunately not: see error below. [FileLoadException: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [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.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38 [ConfigurationErrorsException: 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.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290 System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +549 [HttpException (0x80004005): 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.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10074636 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254 |
did you clear local browser cache? |
No need, uptimerobot also sees the website is down. You can check http://www.bydaans.nl/ yourself |
Your web.config should only have one
|
I deleted some and kept: This did not change the error. As it says in the comments, DNN upgraded to 10..3, I changed the web.config to: This created another error but that is probably related to a module, so...I think I can move on... |
The upgrade package does not include the newtonsoft.json.dll library which causes the upgrade to break if you do not already have v10.0.0.0 installed of the lib. The main install package contains it though
The text was updated successfully, but these errors were encountered: