C# 添加Microsoft.AspNetCore包后无法解析System.Runtime.InteropServices.RuntimeInformation
我遇到了以下问题 我已经创建了一个新的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包没有帮助 有人有类似的问题吗?在我的例子中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
<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更新有关,详细信息如下: