Skip to content
The Chat Archive
gpt-4o-mini-2024-07-18· OpenAI WildChat-4.8M (AI2)

24.12.2024 21:08:48 VoxLog created: 24.12.2024 21:08:48 132 OS: Microsoft Windows NT…

  1. User

    24.12.2024 21:08:48 VoxLog created: 24.12.2024 21:08:48 132 OS: Microsoft Windows NT 6.2.9200.0 24.12.2024 21:08:48 133 Build: 9200 24.12.2024 21:08:48 133 .Net version: 4.0.30319.42000 24.12.2024 21:08:48 133 ready to launch program 24.12.2024 21:08:48 133 safetorun is true 24.12.2024 21:08:48 133 creating main form 24.12.2024 21:08:48 144 Crash: CurrentDomain_UnhandledExceptionSystem.IO.FileLoadException: Не удалось загрузить файл или сборку "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" либо одну из их зависимостей. Найденное определение манифеста сборки не соответствует ссылке на сборку. (Исключение из HRESULT: 0x80131040) Имя файла: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' в eval_g..ctor() в eval_᜖.ᜀ()

  2. Assistant

    The error message you provided indicates that there is a problem with loading the Newtonsoft.Json assembly in your application. Specifically, the error System.IO.FileLoadException suggests that the assembly version expected by your application does not match the version that is available at runtime.

    Here's a breakdown of the error message:

    1. FileLoadException: This type of exception occurs when the .NET runtime is unable to load a specific assembly, in this case, Newtonsoft.Json.

    2. Assembly Version Mismatch: The application is looking for Newtonsoft.Json, Version=12.0.0.0. If the version found in the application's bin directory (or elsewhere in the runtime environment) does not match that version (it could be a different version or not found at all), the error occurs.

    3. PublicKeyToken: This is a way to identify the uniquely published version of the assembly. In this case, 30ad4fe6b2a6aeed corresponds to the Newtonsoft.Json assembly.

    Steps to Resolve the Issue:

    1. Check Installed Version: Verify the installed version of Newtonsoft.Json. You can do this by checking the project's package references or by looking in the bin directory. You might have to update your project to reference the correct version.

    2. Update the Dependency:

      • If you are using NuGet, you can update the package to the required version (12.0.0 in your case). Open the NuGet Package Manager Console and run:
        Update-Package Newtonsoft.Json -Version 12.0.0
        
      • Alternatively, you can edit the packages.config or *.csproj file directly to set the version.
    3. Check Assembly Binding Redirects: Sometimes, .NET applications use binding redirects in configuration files (like app.config or web.config) to redirect older or specific versions of assemblies to a newer version. Ensure that such redirects exist if you want to use a different version. The binding redirect looks something like this:

      <dependentAssembly>
          <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
      
    4. Rebuild the Project: After making changes to the references or configuration, make sure to clean and rebuild your project.

    5. Check for Other Projects: If your application is part of a solution with multiple projects, ensure that all projects are referencing the same version of Newtonsoft.Json.

    6. Deployment: If this is occurring after deployment to another machine, ensure that the necessary assemblies are included with your deployment package.

    By following these steps, you should be able to resolve the FileLoadException and successfully load the Newtonsoft.Json assembly.