2017-09-26 106 views
-1

我在PluralSight上觀看視頻,然後我去github.com/aspnet/Mvc下載源文件並按照說明進行操作。.NET MVC核心當前的SDK不支持.NET標準2.0

當我下載的文件,並試圖運行程序,我結束了:

Severity Code Description Project File Line Suppression State Error The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. Microsoft.AspNetCore.Mvc.Formatters.Xml C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 126

我也跟着this後並單獨下載的2.0核心,但它仍然是給我這個錯誤。即使在我更新到Visual Studio 15.3之後。

任何幫助,非常感謝。謝謝!

Severity Code Description Project File Line Suppression State Error KRB1001 Package references have not been pinned. Run './build.cmd /t:Pin'. Also, you can run './build.cmd /t:Restore' which will pin and restore packages. 'build.cmd' can be found in 'C:\Users\ty_lo\source\Mvc\'. VersioningWebSite C:\Users\ty_lo\source\Mvc\Directory.Build.targets 12

+0

Global.aspx是ASP.NET MVC而不是ASP.NET Core MVC。最好的開始是官方文檔:https://docs.microsoft.com/en-us/aspnet/core/ – Tseng

+0

你下載了2.0,但是你是否將項目設置更改爲2.0? – Alexan

+0

@Alexan我在global.json文件中更改了版本,但是我沒有在項目設置中更改它。這是如何完成的? – giggidy

回答

0

FIX

編輯

刪除源文件,並重新克隆我打開該項目的項目,現在我收到此錯誤後,我似乎已經固定我的解決方案是轉到工具 - >選項 - > NuGet包管理器 - >常規,然後確保選中「在Visual Studio中生成時自動檢查丟失的包」。