Tôi đang cố gắng để xây dựng một giải pháp sử dụng dòng lệnh msbuild và tôi tiếp tục nhận được lỗi này:MSBUILD ném lỗi: SDK 'Microsoft.NET.Sdk' chỉ định không thể tìm thấy
error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
Các phiên bản của msbuild là công cụ mới nhất từ microsoft visual studio 2017. Tôi đang sử dụng Windows Server 2012 R2 và dự án sử dụng .NET Core 2.0.
Đây là lệnh mà tôi đang sử dụng:
msbuild.exe /p:Configuration=Release /t:restore C:\Projects\MyProject.sln
Toàn bộ nhật ký:
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
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 9/16/2017 3:09:03 PM.
Project "C:\Projects\MyProject.sln" on node 1 (restore target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
Project "C:\Projects\MyProject.sln" (1) is building "C:\Projects\Kernel\Kernel.csproj" (2) on node 1 (restore target(s)).
C:\Projects\MyProject.sln" (1) is building "C:\Projects\Kernel\Kernel.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
Done Building Project "C:\Projects\MyProject.sln" (1) is building "C:\Projects\Kernel\Kernel.csproj" (restore target(s)) -- FAILED.
Build FAILED.
"C:\Projects\MyProject.sln" (restore target) (1) ->
"C:\Projects\Kernel\Kernel.csproj" (restore target) (2) ->
C:\Projects\Kernel\Kernel.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
0 Warning(s)
11 Error(s)
Dự đoán của tôi là dự án sẽ tham chiếu đến SDK đó. Và để xây dựng chống lại nó, nó phải được cài đặt. Trình biên dịch có thể thực hiện thao tác gõ và tất cả các thứ khác như thế nào? – Christopher
@Christopher Tôi đã chỉnh sửa bài đăng với nhật ký hoàn chỉnh. Và có, dự án của tôi tham khảo SDK, nhưng tôi đang cố khôi phục nó. –
Như tôi đã nghĩ. Trình biên dịch không thể tìm thấy SDK. Bạn cần nó được cài đặt togeher với Compiler để tạo một build. Lý tưởng nhất là bạn đã chọn vị trí mặc định. Nếu không, bạn có thể phải chỉnh sửa dự án để tìm SDK ở vị trí thích hợp. – Christopher