2016-08-23 93 views
1

我創建了一個新的類庫,接受默認設置,並通過nuget(Sendgrid,System.Data.SqlClient下面)添加了幾個包。Visual Studio沒有提到引用

enter image description here

還有一個project.json:

{ 
    "version": "1.0.0-*", 
    "description": "ClassLibrary1 Class Library", 
    "authors": [ "adamwhitehouse" ], 
    "tags": [ "" ], 
    "projectUrl": "", 
    "licenseUrl": "", 

    "dependencies": { 
    "System.Collections": "4.0.10-beta-23019", 
    "System.Linq": "4.0.0-beta-23019", 
    "System.Threading": "4.0.10-beta-23019", 
    "System.Runtime": "4.0.10-beta-23019", 
    "Microsoft.CSharp": "4.0.0-beta-23019", 
    "System.Data.SqlClient": "4.1.0", 
    "Sendgrid": "8.0.3" 
    }, 

    "frameworks": { 
    "dotnet": { } 
    } 
} 

當我嘗試在生成Class1.cs文件中引用這些,就好像他們不存在,儘管他們似乎被引用像其他人一樣(System.Collections,System.Threading等)。

enter image description here

我所做的,除了我在這裏列出絕對沒有。我確定這是愚蠢的,但我還沒有在Visual Studio中創建一個項目,看起來事情已經發生了變化。我錯過了什麼?

+0

什麼版本的Visual Studio和項目是什麼王? Windows類庫,核心,...? – Mathieu

+0

這是所有問題,與2015年類圖書館項目 – aw04

+0

對不起,但我不能在Windows核心類庫中的Windows類庫neitehr中複製那種類型的項目結構。你的參考文獻是在測試版,我不知道該怎麼做 – Mathieu

回答

0

無論出於何種原因,固定一個類似的問題,我的新項目對話框默認爲類庫(包),這顯然不是我想要的。

當我回去選擇正確的項目類型時,一切都按預期工作。

enter image description here

+1

這就是爲什麼我要求精度的項目類型;) – Mathieu

+0

是的,你是正確的問題 – aw04

+0

感謝分享這個問題的原因。請標記您的答案,這對其他有相同問題的社區是有好處的。 –

0

嘗試在控制檯的NuGet運行Update-Package -reinstall,我加入了-reinstall部分