dotnet restore
or dotnet build
CLI should restore NuGet packages as expected without any errors
Console shows error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.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.
The SqlTasks.target identified file is actually located at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SSDT
. Why is it the dotnet sdk path? Does it have something to do with an environment or project variable? Here is the relevant section from the .sqlproj:
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4
the dotnet command only supports SDK based projects. It seems like your solution has some projects that are not support by the dotnet CLI.
I suggest you restore through msbuild /t:restore and build using msbuild /t:build. MSBuild will support all projects types.
If this does not solve your issue, please re-activate.
That's fine that it only supports SDK based projects, but when scanning a solution file (.sln) or folders for projects (.csproj, .sqlproj), why doesn't it just skip non-SDK based projects instead of throwing an error. It's not breaking my build process, but it is logging it and I've had to teach the devs on my team to simply ignore it.
@livarcocc that means the whole linux-based CI chain would be broken if a SQL server project just was included into the solution.
I propose to re-open the issue if there is no workaround except installing MSBuild on Linux.
I am also getting errors on this. Seems strange it would try to do a restore on a project type that is not supported.
@DaveSlinn @ilya-chumakov @smasherprog This issue seems pretty dead. If you want a fix, you'll probably get further by opening a new issue.
@livarcocc please, reopen this issue. dotnet restore
and dotnet build
still has issues with solutions which use .sqlproj projects. How are we supposed to build our solutions when .NET Core just fails the whole build?
This needs to be reevaluated.
+1
Most helpful comment
@livarcocc that means the whole linux-based CI chain would be broken if a SQL server project just was included into the solution.
I propose to re-open the issue if there is no workaround except installing MSBuild on Linux.