Microsoft.Build.Sql doesn't work on Linux
See original GitHub issue- SqlPackage or DacFx Version: not using DacFx, just
Microsoft.Build.Sql
as described in the docs - .NET Framework (Windows-only) or .NET Core:
- Environment (local platform and source/target platforms): Ubuntu 20.04
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:
(DacFx/SqlPackage/SSMS/Azure Data Studio)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Basically you need to run the “sqlpackage” tool with the Publish action.
Did you build with: