microsoft / DacFx

SQL Server database schema validation, deployment, and upgrade runtime. Enables declarative database development and database portability across SQL Server versions and environments.
https://aka.ms/sqlpackage-ref
MIT License
292 stars 15 forks source link

Support dotnet publish #447

Open benjamin-hodgson opened 1 month ago

benjamin-hodgson commented 1 month ago

My sqlproj looks like this

<Project Sdk="Microsoft.Build.Sql/0.1.15-preview">

    <PropertyGroup>
        <Name>MyDb</Name>
        <DSP>Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider</DSP>
        <ModelCollation>1033, CI</ModelCollation>
    </PropertyGroup>

</Project>

I'd like to publish the output dacpac to a folder (along with my other projects) for deployment. Using dotnet publish throws an error:

C:\Program Files\dotnet\sdk\8.0.205\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(164,5): error MSB4036: 
 The "AllowEmptyTelemetry" task was not found. Check the following: 1.) The name of the task in the project file is the 
 same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask  
interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in  
the "C:\Program Files\dotnet\sdk\8.0.205" directory. [D:\test\MyDb\MyDb.sqlproj]