,並不能得到的NuGet包使用還原/ T:作爲記錄here.恢復開關。該解決方案是一個相當簡單的ASP.NET MVC應用程序和MSTest項目。如果我在本地開發文件夾或構建服務器上運行恢復標誌,我看不到要恢復的NuGet包,即使我刪除了包,obj和bin文件夾。的MSBuild 15.1/4的NuGet不恢復我試圖通過命令行運行的MSBuild包
我已經啓用自動下載的文件here。如果我使用Studio打開該項目並構建它,則會按預期恢復包。這僅在使用MSBuild時失敗。
這一切正在與Visual Studio 2017年最新的補丁級別進行。生成機器有Professional,我的機器有Enterprise。兩者都有相同的行爲。
有沒有人得到的MSBuild使用的MSBuild 15.1挽回的NuGet包?
C:\Users\me\Documents\Visual Studio 2017\Projects\cmbs-admin>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m"switch.
Build started 6/22/2017 2:01:57 PM.
Project "C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject.sln" on node
1 (Restore target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Restore:
Restoring packages for C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject.Tests\MyProject.Tests.csproj...
Restoring packages for C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject\MyProject.csproj...
Committing restore...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject\obj\project.assets.json
Lock file has not changed. Skipping lock file write. Path: C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject.Tests\obj\project.assets.json
Restore completed in 350.01 ms for C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject\MyProject.csproj.
Restore completed in 349.87 ms for C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject.Tests\MyProject.Tests.csproj.
NuGet Config files used:
C:\Users\me\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Done Building Project "C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject\MyProject.sln" (Restore target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.18
C:\Users\me\Documents\Visual Studio 2017\Projects\MyProject>
你嘗試恢復什麼樣的項目? 'NuGet.exe恢復'仍然是非.NET核心項目的選項。 –
它是一個傳統的基於CSPROJ的項目。你是說Nuget.exe是選項還是AN選項? http://blog.nuget.org/20170316/NuGet-now-fully-integrated-into-MSBuild.html –
我發現,通過改變的csproj使用PackageReference語法代替參考(如在我以前的鏈接注意評論),事情工作。看起來這是MVC Web App CSPROJ模板的問題,而不是MSBuild。 –