Hyper-V Manager Quick Create Fails with "Cannot load file or assembly Newtonsoft.Json"

Stephen P 41 Reputation points
2025-02-03T11:25:00.3033333+00:00

Creating a new virtual machine using Hyper-V Manager in Windows 11 24H2 results in the following error message:

Image

Attempts to resolve the issue include removing and reinstalling Hyper-V and the .NET Frameworks, as well as running SFC /Scannow and DISM /Online /Cleanup-Image /RestoreHealth, but the problem persists.

Additionally, Visual Studio 2022 Community is installed, and Newtonsoft.Json is present in at least one project, with the latest version being 13.0.3.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,806 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,189 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,636 questions
{count} votes

1 answer

Sort by: Most helpful
  1. jeet gaglani 5 Reputation points
    2025-02-03T13:28:50.0066667+00:00

    Hey Stephen,

    Possible Causes:

    1. Version Mismatch in Newtonsoft.Json

    The application (Hyper-V Manager or another system component) expects Newtonsoft.Json version 12.0.0.0, but a different version (like 13.0.3) is installed.

    If a newer version is installed globally or referenced by another application, it may cause a conflict.

    1. Corrupted Assembly or Incorrect Installation

    The installed Newtonsoft.Json package might be corrupt.

    The manifest file in the GAC (Global Assembly Cache) or application directory might not match the expected version.

    1. System File Corruption

    Even though you ran SFC and DISM, some underlying system dependencies might still be causing an issue.

    1. Conflicting .NET Versions

    If multiple .NET versions are installed, the Hyper-V Manager might be picking up an incorrect dependency.

    ------------------Solutions that you can try------------------

    1. Check the Installed Newtonsoft.Json Versions

    Open PowerShell and run:

    Get-Package -Name Newtonsoft.Json
    

    If multiple versions are installed, you may need to uninstall conflicting versions.

    1. Force Install Newtonsoft.Json 12.0.0.0

    Open PowerShell as Administrator and run:

    Install-Package Newtonsoft.Json -Version 12.0.0
    

    Alternatively, if using NuGet in Visual Studio:

    Open NuGet Package Manager.
    
    Search for Newtonsoft.Json.
    
    Downgrade to version 12.0.0.
    
    1. Manually Add Binding Redirects

    Navigate to:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
    

    or (for 64-bit)

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
    

    Add the following inside the <configuration> section:

    <configuration>

    <runtime>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    
      <dependentAssembly>
    
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    
        <bindingRedirect oldVersion="0.0.0.0-13.0.3.0" newVersion="12.0.0.0" />
    
      </dependentAssembly>
    
    </assemblyBinding>
    

    </runtime>

    </configuration>

    Restart the computer and try again.

    1. Clear the Global Assembly Cache (GAC)

    Open Command Prompt (Admin) and run:

    gacutil /l Newtonsoft.Json
    

    If multiple versions exist, remove the incorrect ones:

    gacutil /u Newtonsoft.Json
    

    Reinstall version 12.0.0.0.

    1. Repair .NET Framework

    Open Command Prompt (Admin) and run:

    dotnet --list-runtimes
    

    If any installations seem broken, reinstall .NET Framework:

    Go to Settings → Apps → Installed Apps.

    Find .NET Framework, click Modify, and choose Repair.

    1. Reinstall Hyper-V (Again)

    If the issue persists, try:

    Uninstall Hyper-V completely using PowerShell:

    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
    

    Restart your PC.

    Reinstall Hyper-V:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.