Forum Discussion
Method not found: 'Void Newtonsoft.Json.JsonSerializerSettings..ctor(Newtonsoft.Json.JsonSerializer"
Run this PowerShell command and it will fix the issue.
# -----------------------------
# Install Newtonsoft.Json 13.0.3 to GAC (keep old versions)
# -----------------------------
# Temp folder for download
$tempBase = "C:\Temp\NewtonsoftInstall"
New-Item -ItemType Directory -Force -Path $tempBase | Out-Null
# Target version
$version = "13.0.3"
$publicKeyToken = "30ad4fe6b2a6aeed"
# NuGet package URL
$nugetUrl = "https://www.nuget.org/api/v2/package/Newtonsoft.Json/$version"
# Folder for this download
$tempPath = Join-Path $tempBase "Newtonsoft_$version"
New-Item -ItemType Directory -Force -Path $tempPath | Out-Null
# Download NuGet package
$nupkgPath = Join-Path $tempPath "newtonsoft.nupkg"
Invoke-WebRequest -Uri $nugetUrl -OutFile $nupkgPath
# Rename .nupkg to .zip for extraction
$zipPath = Join-Path $tempPath "newtonsoft.zip"
Rename-Item -Path $nupkgPath -NewName "newtonsoft.zip"
# Extract ZIP
Expand-Archive -Path $zipPath -DestinationPath $tempPath -Force
# Locate net45 DLL
$dllPath = Get-ChildItem -Path $tempPath -Recurse -Filter "Newtonsoft.Json.dll" |
Where-Object { $_.FullName -match "\\net45\\" } |
Select-Object -First 1
if (-not $dllPath) { throw "ERROR: Newtonsoft.Json.dll not found!" }
# GAC path for this version
$gacRoot = "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Newtonsoft.Json"
$gacFolder = "$gacRoot\$version`__$publicKeyToken"
# Skip if this exact version is already installed
if (Test-Path $gacFolder) {
Write-Host "Newtonsoft.Json version $version already exists in GAC."
return
}
# Create GAC folder
New-Item -ItemType Directory -Path $gacFolder -Force | Out-Null
# Take ownership & set permissions
takeown /f $gacFolder /r /d y | Out-Null
icacls $gacFolder /grant administrators:F /t | Out-Null
# Copy DLL into GAC
Copy-Item $dllPath.FullName -Destination $gacFolder -Force
Write-Host "Installed Newtonsoft.Json version $version into GAC."
Write-Host "Location: $gacFolder"
thank you, worked for me.