2017-09-04 37 views
0

我遇到以下問題。添加Microsoft.AspNetCore包後無法解析System.Runtime.InteropServices.RuntimeInformation

我已經創建了一個新的lib項目,其目標是.net framework 4.6.2 並通過NuGet引用System.Runtime.InteropServices.RuntimeInformation包。 (對象瀏覽器顯示該dll版本爲4.0.1.0,(在我指向安裝程序4.3的nuget中))

我重新加載項目,檢查是否沒有引用問題。

現在我安裝了Microsoft.AspNetCore,我重新加載了該項目,並且引用了 System.Runtime.InteropServices.RuntimeInformation和System.Net.Htpp消失了。

enter image description here

PS。安裝.net標準包沒有幫助。

有沒有人有類似的問題?

+0

請包括輸出窗口中的實際警告(以文本形式)。警告圖標的屏幕截圖不是特別有用。 –

+0

您使用的是哪個版本的visual studio? –

+0

@MartinUllrich和2017 15.3.3 – aph5

回答

1

在我的情況下加

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

到的csproj文件幫助。 我仍然缺少參考文獻,但在運行項目時,我沒有收到任何丟失的文件例外

+1

這可能與Visual Studio更新有關,這裏有更多信息:https://developercommunity.visualstudio.com/content/problem/95070/could-not-load-file-or-assembly-systemruntime-vers.html – adrian

相關問題