microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.5k stars 883 forks source link

Commented out properties in publish profile are still applied #25474

Open stijnherreman opened 1 year ago

stijnherreman commented 1 year ago

Steps to Reproduce:

  1. Create a project using <Sdk Name="Microsoft.Build.Sql" Version="0.1.7-preview" />
  2. Create a publish profile with a commented out property:
    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     <PropertyGroup>
       <!-- <DropObjectsNotInSource>False</DropObjectsNotInSource> -->
     </PropertyGroup>
    </Project>
  3. Publish the project to an existing database with the 'Generate Script' action
  4. No IF EXISTS ... RAISERROR statements are generated.
  5. Remove the commented out property or replace it with an incorrect identifier, e.g. <!-- <BlahDropObjectsNotInSource>False</BlahDropObjectsNotInSource> -->
  6. IF EXISTS ... RAISERROR statements are generated.

Did this occur in prior versions? If not - which version(s) did it work in? n/a

zijchen commented 4 months ago

I think this is an ADS/SqlToolsService bug. I cannot repro this using SqlPackage or calling DacServices directly. But I can repro in ADS.