ファイルまたはアセンブリを読み込めませんでしたSystem.Runtime.CompilerServices.Unsafe
System.Runtime.CompilerServices.Unsafenugetパッケージ4.5.3をインストールしたようです バージョン。そして、それはSystem.Runtime.CompilerServices.Unsafe.dllに対応します アセンブリバージョン4.0.4.1 。
提案
1) System.Runtime.CompilerServices.Unsafeを登録してみてください バージョン4.0.4.1 システムがそれを実行できるようにGACに挿入します。
-
VS2019の開発者コマンドプロンプトを実行します 管理者として
-
タイプ:
cd xxxxx (the path of the the System.Runtime.CompilerServices.Unsafe 4.0.4.1) gacutil /i System.Runtime.CompilerServices.Unsafe.dll
2) xxx.configでNetFrameworkプロジェクトを使用する場合 ファイルの場合、bindingRedirectを使用できます。
これらをapp.configに追加します ファイルまたはweb.config ファイル:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1"
newVersion="4.0.4.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
ほか 、System.Runtime.CompilerServices.Unsafeを更新した場合 nugetパッケージのバージョンを新しいバージョンに変更するには、bindingRedirectアセンブリのバージョンも変更する必要があります。
これらのアセンブリバージョンのSystem.Runtime.CompilerServices.Unsafeを参照できます。
4.5.x System.Runtime.CompilerServices.Unsafeです 4.0.x.x中のnugetパッケージバージョン System.Runtime.CompilerServices.Unsafe.dllです。 アセンブリバージョン。
4.5.0 is 4.0.4.0
4.5.1 is 4.0.4.0
4.5.2 is 4.0.4.0
4.5.3 is 4.0.4.1
4.6.0 is 4.0.5.0
4.7.0 is 4.0.6.0
4.7.1 is 4.0.6.1
5.0.0 is 5.0.0.0