Copied to clipboard

Flag this post as spam?

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


  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 12:13
    Mike
    0

    Post Installation IDE Setup

    I Installed from nuget and ran the installation.  This generated a whole lot of new files which I included into the project.

    I then ran the project and I got the error:

    Could not load file or assembly 'Newtonsoft.Json'

    I am guessing this is because the "packges" folder is not included in my project.  How do I include this folder so references work?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 12:44
    Jan Skovgaard
    0

    Hi Mike

    I think it's a known issue but have not been able to find it on the issue tracker yet - But I think there is a fix coming in v7.1.5 if I remember correctly.

    In the mean time could you try doing what Damiaan describes in the web.config and see if it works? http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/49795-Issue-upgrade-from-710-to-711-NewtonsoftJSON#comment179032

    /Jan

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 13:03
    Jeavon Leopold
    0

    Do you have a Newtonsoft.Json.6.0.3 folder in your packages folder? If you do can you check if you have Newtonsoft.Json.dll in the bin folder of your solution?

  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 13:12
    Mike
    0

    My web.config entry is:

          <dependentAssembly>

            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />

            <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />

          </dependentAssembly>

    There is a file "Newtonsoft.Json.dll" in my bin folder.

    In my packages folder the version of Newtonsoft.Json is 6.0.2.

    Is the version difference the issue?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 13:15
    Jeavon Leopold
    0

    Looks fine, are you including your bin folder in your VS solution, if you are, you should exclude it and then try a rebuild.

  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 13:31
    Mike
    0

    I excluded it and rebuilt. Same error. Here is full output:

    Server Error in '/' Application.

    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)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.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)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Newtonsoft.Json' could not be loaded.

    === Pre-bind state information === LOG: DisplayName = Newtonsoft.Json (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: Newtonsoft.Json | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///c:/users/mike/documents/visual studio 2012/Projects/UmbracoTest/UmbracoTest/ LOG: Initial PrivatePath = c:\users\mike\documents\visual studio 2012\Projects\UmbracoTest\UmbracoTest\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: c:\users\mike\documents\visual studio 2012\Projects\UmbracoTest\UmbracoTest\web.config LOG: Using host configuration file: C:\Users\Mike\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Users/Mike/AppData/Local/Temp/Temporary ASP.NET Files/root/519c3a36/6ad81b98/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///C:/Users/Mike/AppData/Local/Temp/Temporary ASP.NET Files/root/519c3a36/6ad81b98/Newtonsoft.Json/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///c:/users/mike/documents/visual studio 2012/Projects/UmbracoTest/UmbracoTest/bin/Newtonsoft.Json.DLL. LOG: Using application configuration file: c:\users\mike\documents\visual studio 2012\Projects\UmbracoTest\UmbracoTest\web.config LOG: Using host configuration file: C:\Users\Mike\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 6.0.0.0. LOG: Post-policy reference: Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed LOG: Attempting download of new URL file:///C:/Users/Mike/AppData/Local/Temp/Temporary ASP.NET Files/root/519c3a36/6ad81b98/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///C:/Users/Mike/AppData/Local/Temp/Temporary ASP.NET Files/root/519c3a36/6ad81b98/Newtonsoft.Json/Newtonsoft.Json.DLL. LOG: Attempting download of new URL file:///c:/users/mike/documents/visual studio 2012/Projects/UmbracoTest/UmbracoTest/bin/Newtonsoft.Json.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

    Stack Trace:

    [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=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)] 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) +34
    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) +16 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=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)]
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
    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() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

    [HttpException (0x80004005): 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)]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885060 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 13:48
    Jeavon Leopold
    0

    Is your project set to compile against .net framework v4.5 or v4.0?

  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 14:26
    Mike
    0

    4.5. I tried changing to 4.0 but VS informed me that Newtonsoft.Json was targetted to 4.5

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 15:30
    Jeavon Leopold
    0

    In the /bin folder if you right click on the Newtonsoft.Json.dll and select properties, what version does it show you?

  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 15:36
    Mike
    0

    VS doesn't show any file version in properties. If I right click in windows and go properties I can see File Version: 4.5.11.15520

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 24, 2014 @ 15:37
    Jeavon Leopold
    0

    Ah ha, that's wrong!

    Try copying packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll to bin\Newtonsoft.Json.dll

  • Mike 15 posts 34 karma points
    Jun 24, 2014 @ 15:54
    Mike
    0

    It was exactly the same file in the packages folder so I downloaded latest version from codeplex and with this dll it worked!

    Thank you very much for the help. A great first impression of the community :)

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 25, 2014 @ 15:47
    Jeavon Leopold
    0

    Wow, that's strange, seems that Nuget really messed up for you! Glad you're up and running now.

Please Sign in or register to post replies

Write your reply to:

Draft