我真的很想在這裏用nuget和Visual Studio Team Services(visualstudio.com)構建一個解決方案。任何幫助都感激不盡。nuget未下載Visual Studio Team Services(visualstudio.com)下的軟件包(自動修復包)
我有一個包含36個項目的解決方案。許多項目使用相同的5或6個nuget軟件包。我仔細地遵循了Migrating MSBuild-Integrated solutions to use Automatic Package Restore的說明,因此在我的解決方案文件夾下有一個.nuget文件夾,其中包含一個NuGet.Config文件,不再包含Nuget.exe或Nuget.targets文件。所有項目都刪除了它們的Nuget.targets行。
我使用的是Visual Studio 2013 Professional(v12 Update 2),解決方案在本地生成,沒有錯誤或警告。即使在清理並刪除軟件包文件夾後,它也會下載並生成。包文件夾不會被簽入Visual Studio Team Services。
檢查構建日誌表明:
- 的NuGet沒有在建造開始,以檢查,下載並解壓任何未解決的包從MSBuild-遷移之前踢(有人這樣做集成到自動軟件包還原 - 儘管如此,它不能解決引用)
- 我剩下113錯誤,集中在項目無法解決引用的事實。
- 與本地構建(和MSBuild集成)不同,Visual Studio團隊服務現在甚至不提供提及 nuget在其構建日誌中!
事情開始失敗(儘管這顯然是因爲的NuGet還沒有介入)日誌的一個例子:
Project "C:\a\src\TFS\RSPlatform\Main\Source\RSPlatform Team Project.sln" (1) is building "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\A2Refresh.csproj" (8) on node 1 (default targets).
PrepareForBuild:
Creating directory "obj\Release\".
ResolveAssemblyReferences:
Primary reference "Bytescout.Spreadsheet".
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Bytescout.Spreadsheet". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\A2Refresh.csproj]
For SearchPath "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies".
Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.winmd", but it didn't exist.
Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.dll", but it didn't exist.
Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.exe", but it didn't exist.
For SearchPath "{HintPathFromItem}".
Considered "..\..\packages\Bytescout.Spreadsheet.2.4.0.1346\lib\net45\Bytescout.Spreadsheet.dll", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.exe", but it didn't exist.
For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.5.1,AssemblyFoldersEx}".
Considered AssemblyFoldersEx locations.
For SearchPath "{AssemblyFolders}".
任何人都可以建議我應該如何獲得Visual Studio團隊服務使用的NuGet? 如果自動包恢復建議刪除~/.nuget/NuGet.exe
,Visual Studio Team Services甚至會如何使用NuGet?
由於提前, 克里斯
你有沒有想出解決出來嗎?我有大約12小時的試用和錯誤沒有運氣。答案中的鏈接指出,VSO的默認工作流程應該已經處理了這個問題,但是我已經打開它並確認nuget包恢復未實現。 –
嗨鬆餅人, 我沒有。 @ probackpacker的迴應確實有助於讓nuget開始啓動並執行包恢復過程,但是當它繼續構建解決方案/項目時,相關項目仍然無法找到程序集。看我的日誌文件(6月26日在9:09),我已經有多遠了。 –
這是**不**好。我坐在一個比你的30多個項目更簡單的設置,我仍然可以再現這種愚蠢的不端行爲!我有一個(1!)文件,* Program.cs *的控制檯應用程序。所有的工作都很好,直到我添加了NuGet的任何東西 - 我嘗試了EF和nUnit。然後 - 噗!什麼都沒有了。我不認爲這是不可能解決的,只是MS的一個非常愚蠢的設置。任何提示? –