question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.Build.Sql doesn't work on Linux

See original GitHub issue

Steps to Reproduce:

git clone https://github.com/zwcloud/Kandu
git checkout fixSqlProj
dotnet build

See error:

root@localhost:~/kandu# dotnet build
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

/root/kandu/Sql/Sql.sqlproj : warning NU1503: Skipping restore for project '/root/kandu/Sql/Sql.sqlproj'. The project file may be invalid or missing targets required for restore. [/root/kandu/Kandu.sln]
  Determining projects to restore...
  All projects are up-to-date for restore.
  Query -> /root/kandu/Query/bin/Debug/net5.0/Query.dll
  Core -> /root/kandu/Core/bin/Debug/net5.0/Kandu.Core.dll
  Kandu -> /root/kandu/App/bin/Debug/net6.0/Kandu.dll
/root/.nuget/packages/microsoft.build.sql/0.1.3-preview/sdk/Sdk.targets(12,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/6.0.302/Microsoft/VisualStudio/v16.0/SSDT/Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/6.0.302//Microsoft/VisualStudio/v16.0/SSDT/Microsoft.Data.Tools.Schema.SqlTasks.targets" is correct, and that the file exists on disk. [/root/kandu/Sql/Sql.sqlproj]

https://github.com/microsoft/DacFx/blob/d39dcf99b6032cfb3723eb382ea3cb4f54ab1f9d/src/Microsoft.Build.Sql/sdk/Sdk.targets#L12 This line still references a file from Visual Studio: $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets

Did this occur in prior versions? If not - which version(s) did it work in? No. But I have tried to run dotnet build on windows and it works: image (DacFx/SqlPackage/SSMS/Azure Data Studio)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, Jul 27, 2022

Basically you need to run the “sqlpackage” tool with the Publish action.

1reaction
ErikEJcommented, Jul 27, 2022

Did you build with:

dotnet build /p:NetCoreBuild=true
Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation guidance for SQL Server on Linux
Install, update, and uninstall SQL Server on Linux. This article covers online, offline, and unattended scenarios.
Read more >
Troubleshoot SQL Server on Linux
This article describes how to troubleshoot SQL Server running on Linux or in a Linux container. When troubleshooting SQL Server on Linux, ...
Read more >
Build .sqlproj on Linux - Microsoft Q&A
Hello everyone, I have been using on Azure DevOps the task VSBuild to build, in a .yml pipeline, a Visual Studio Solution containing...
Read more >
SQL Server on Linux Frequently Asked Questions (FAQ)
This article provides answers to frequently asked questions (FAQ) about SQL Server running on Linux.
Read more >
Ubuntu: Install SQL Server on Linux
This quickstart shows how to install SQL Server 2017 or SQL Server 2019 on Ubuntu and then create and query a database with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found