【发布时间】:2018-07-09 05:38:14
【问题描述】:
我正在尝试构建一个 .NET Core 2.0 解决方案,它有一个空白的空 SQL Server 项目,但收到此错误:
MyDb.sqlproj(57,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.4\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.
targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
如果我像这样直接调用 MSBuild,解决方案可以在 VS2017 以及命令行中正确构建: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" MySolution.sln /t:build /fl /flp:logfile=MyProjectOutput.log;verbosity=diagnostic
Cake 脚本如下所示:
Task("Build")
.IsDependentOn("RestoreNuGetPackages")
.IsDependentOn("SetVersion")
.Does(() =>
{
Information("Running DotNetCoreBuild");
DotNetCoreBuild("../MySolution.sln", new DotNetCoreBuildSettings {
Configuration = configuration
});
});
请告诉我为什么会出现该错误? 谢谢
【问题讨论】: