DacFx icon indicating copy to clipboard operation
DacFx copied to clipboard

Building SSDT project for with dotnet tooling (Microsoft.Build.Sql - 0.1.3-preview)

Open ben-purcell opened this issue 3 years ago • 2 comments

  • SqlPackage or DacFx Version: Microsoft.Build.Sql 0.1.3-preview
  • .NET Framework (Windows-only) or .NET Core: both
  • Environment (local platform and source/target platforms):
    • Windows 10
    • Visual Studio 2022 Community

Steps to Reproduce:

  1. Create a new Database Project in Visual Studio 2022
  2. Add a post deploy script
  3. Reference another file in the post deploy script - the build action should be none for the script, like so:
: .\myfile.sql
  1. So far everything should still build
  2. Add a reference to the Microsoft.Build.Sql as per https://github.com/microsoft/DacFx/tree/main/src/Microsoft.Build.Sql
<Project ...
  <Sdk Name="Microsoft.Build.Sql" Version="0.1.3-preview" />
  ...
</Project>
  1. Try to build the project - it will no longer work and you will an error:
Build error SQL70001: This statement is not recognized in this context.

Did this occur in prior versions? If not - which version(s) did it work in? no idea

(DacFx)

ben-purcell avatar May 04 '22 09:05 ben-purcell

Hi @ben-purcell thank you for opening this issue. Right now SDK-style database projects are only supported on the 'SQL Database Projects' extension in Azure Data Studio or VS Code. Support in SSDT will be added in a future release.

zijchen avatar May 10 '22 18:05 zijchen

It's 2 years later, when in this support for Visual Studio going to arrive?

andrew-sumner avatar Apr 10 '24 22:04 andrew-sumner

Consolidating into #180, as there's some workaround discussions there. We are working on the Visual Studio support for SDK-style SQL projects and will be posting updates there.

dzsquared avatar Jun 07 '24 13:06 dzsquared