Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从.net程序集返回的获取类型无法解析对程序集的依赖关系';System.Runtime,版本=4.2.1.0';_C#_.net_Powershell_Reflection - Fatal编程技术网

C# 从.net程序集返回的获取类型无法解析对程序集的依赖关系';System.Runtime,版本=4.2.1.0';

C# 从.net程序集返回的获取类型无法解析对程序集的依赖关系';System.Runtime,版本=4.2.1.0';,c#,.net,powershell,reflection,C#,.net,Powershell,Reflection,我有一个.net项目,我需要使用PowerShell从中获取方法列表,所以我这样做了 $testSuite = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom("c:\dev\project\integrations-tests-poc\Container1.IntegrationTests\bin\Debug\netcoreapp2.2\Container1.IntegrationTests.dll") 然后当我试图 $testSui

我有一个.net项目,我需要使用PowerShell从中获取方法列表,所以我这样做了

$testSuite = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom("c:\dev\project\integrations-tests-poc\Container1.IntegrationTests\bin\Debug\netcoreapp2.2\Container1.IntegrationTests.dll")
然后当我试图

$testSuite.GetTypes()
它回来了

无法解析对程序集“System.Runtime,Version=4.2.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”的依赖关系,因为它没有 已预加载。使用ReflectionOnly API时,必须通过 反射onlyassemblyresolve事件

我检查了我的NuGet软件包存储,没有这个版本的软件包,我无法从任何地方下载。我做错了什么