Bump Newtonsoft.json from 9.0.1 to 13.0.1 (#30)

* Bump Newtonsoft.json from 9.0.1 to 13.0.1

Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 9.0.1 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/9.0.1...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: add assembly redirect for Newtonsoft.Json

NJsonSchema depends on Newtonsoft.Json 9.x, which we are upgrading
to 13. Adding an assembly resolver so that the NJsonSchema library
references the updated Newtonsoft.Json assembly.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrea Spadaccini <andrea.spadaccini@microsoft.com>
Co-authored-by: Andrea Spadaccini <andreas@microsoft.com>
This commit is contained in:
dependabot[bot] 2022-07-05 12:42:46 +02:00 коммит произвёл GitHub
Родитель dc2910031d
Коммит 4154e90fc6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -32,6 +32,20 @@ if (-not (Test-Path -Path $jsonLibPath -PathType Leaf)) {
}
Write-Verbose "Found JSON.Net assembly at $jsonLibPath"
Write-Verbose "Adding assembly resolver."
$onAssemblyResolve = [System.ResolveEventHandler] {
param($sender, $e)
if ($e.Name -like 'Newtonsoft.Json, *') {
Write-Verbose "Resolving '$($e.Name)'"
return [System.Reflection.Assembly]::LoadFrom($jsonLibPath)
}
Write-Verbose "Unable to resolve assembly name '$($e.Name)'"
return $null
}
[System.AppDomain]::CurrentDomain.add_AssemblyResolve($onAssemblyResolve)
try {
$jsonType = Add-Type -Path $jsonLibPath -PassThru
$jsonSchemaType = Add-Type -Path $schemaLibPath -PassThru
@ -42,6 +56,10 @@ try {
throw
}
# Unregister the assembly resolver.
Write-Verbose "Removing assemlby resolver."
[System.AppDomain]::CurrentDomain.remove_AssemblyResolve($onAssemblyResolve)
$script:schema = $null
try {
Write-Verbose "Reading JSON schema..."

Просмотреть файл

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.json" Version="13.0.1" />
<PackageReference Include="NJsonSchema" Version="9.13.19" />
</ItemGroup>