Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan Egil Kristiansen 37 posts 160 karma points
    Oct 12, 2017 @ 10:55
    Jan Egil Kristiansen
    0

    I broke Umbraco 7.1.8 by installing json.net 10

    After installing json.net 10 in Visual Studio, I get the following error:

    Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified.

    So I try to back out. Tools > NuGet Package manager > Packages for solution...> Installed , I find JSON.net 10.0.3 on the left, but 6.0.4 to the right:

    enter image description here

    I find that slightly mystifying, as the only Uninstall-button I see, applies to 6.0.4. If I try that, I am not allowed to, because Umbraco needs it. Fair enough, but how do I get rid of version 10.0.3?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 12, 2017 @ 11:24
    Alex Skrypnyk
    0

    Hi Jan

    Did you try to restore nuget packages for the solution?

    Thanks,

    Alex

  • Jan Egil Kristiansen 37 posts 160 karma points
    Oct 12, 2017 @ 11:42
    Jan Egil Kristiansen
    0

    Uh...no.

    I guess that is my question: How do I do that?

  • Jakob Kristensen 36 posts 169 karma points
    Oct 12, 2017 @ 12:08
    Jakob Kristensen
    1

    You could delete packages and rebuild and see if you have a reference conflict, other than that you could also find the dependant assembly which proably would read like this

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
      </dependentAssembly>
    

    Add the 10 on it

      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="9.0.0.0" />
      </dependentAssembly>
    

    Then it will take both

  • Jan Egil Kristiansen 37 posts 160 karma points
    Oct 12, 2017 @ 14:33
    Jan Egil Kristiansen
    0

    I tried to restore from the NuGetBackup folder. Things look even worse. (Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method )

    I guess I'll try to reinstall Umbraco, pull my code from Bitbucket and my data from the production server. If nothing else, that should be a useful emergency exercise.

  • John Bergman 483 posts 1132 karma points
    Oct 13, 2017 @ 04:17
    John Bergman
    0

    Try this...

    Delete the newtonsoft json assembly from your bin directory.

    Change the dependent assembly config to this

     <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
    

    Make sure you have the 10.0 version of the package installed

    If you have more than one project in your solution, make sure you upgrade them all to the same version.

    Rebuild.

  • Jan Egil Kristiansen 37 posts 160 karma points
    Oct 16, 2017 @ 18:24
    Jan Egil Kristiansen
    0

    I ended up re-building my test site from a git repository. That was a valuable experience.

    I installed JSON.net 10 because I didn't realize that version 6 was already included in Umbraco.

    It was scary to see how easily I broke the site, but it feels really good to see that I got it back from git.

Please Sign in or register to post replies

Write your reply to:

Draft