Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.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# 添加Microsoft.AspNetCore包后无法解析System.Runtime.InteropServices.RuntimeInformation_C#_.net_.net Core - Fatal编程技术网

C# 添加Microsoft.AspNetCore包后无法解析System.Runtime.InteropServices.RuntimeInformation

C# 添加Microsoft.AspNetCore包后无法解析System.Runtime.InteropServices.RuntimeInformation,c#,.net,.net-core,C#,.net,.net Core,我遇到了以下问题 我已经创建了一个新的lib项目,目标是.NETFramework 4.6.2 并通过NuGet引用System.Runtime.InteropServices.RuntimeInformation包。(对象浏览器显示该dll的版本为4.0.1.0(在nuget中,我指向instal 4.3版)) 我重新加载项目,以检查引用是否没有问题 现在,我安装了Microsoft.AspNetCore,重新加载项目,并引用 System.Runtime.InteropServices.Ru

我遇到了以下问题

我已经创建了一个新的lib项目,目标是.NETFramework 4.6.2 并通过NuGet引用System.Runtime.InteropServices.RuntimeInformation包。(对象浏览器显示该dll的版本为4.0.1.0(在nuget中,我指向instal 4.3版))

我重新加载项目,以检查引用是否没有问题

现在,我安装了Microsoft.AspNetCore,重新加载项目,并引用 System.Runtime.InteropServices.RuntimeInformation和System.Net.Htpp不见了

另外,安装.netstandard包没有帮助

有人有类似的问题吗?

在我的例子中

<PropertyGroup>
  <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

真的
真的
对csproj文件有帮助。
我仍然得到缺少的引用,但是在运行项目时,我没有得到任何缺少的文件异常

System.Runtime.InteropServices.RuntimeInformation
最低支持.net framework版本是
4.7.1
。您可以在

中看到详细信息。请在输出窗口中包含实际警告(作为文本)。警告图标的屏幕截图不是特别有用。您使用的是哪个版本的visual studio?@MartinUllrich vs 2017 15.3。3@MartinUllrich我只找到以下内容:警告未找到引用的组件“System.Runtime.InteropServices.RuntimeInformation”。ClassLibrary1这可能与Visual Studio更新有关,详细信息如下: