Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid value for the "SqlTarget" parameter of the "SqlBuildTask" task. #409

Closed
greg84 opened this issue Feb 13, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@greg84
Copy link

greg84 commented Feb 13, 2024

  • SqlPackage or DacFx Version: SqlPackage 162.1.172
  • .NET Framework (Windows-only) or .NET Core: net 8
  • Environment (local platform and source/target platforms): Windows

Steps to Reproduce:

  1. Added the following line inside <Project> in my sqlproj file:

<Sdk Name="Microsoft.Build.Sql" Version="0.1.14-preview" />

  1. Run dotnet build from the folder containing the sqlproj file.

Build fails with this error:

C:\Users\me.nuget\packages\microsoft.build.sql\0.1.14-preview\tools\netstandard2.1\Microsoft.Data.Tools.Schema.SqlTasks.targets(546,7): error MSB4094: "D:\myproject\bin\Debug\mydatabase.dacpac;D:\myproject\bin\Debug\mydatabase.dacpac" is an invalid value for the "SqlTarget" parameter of the "SqlBuildTask" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". [D:\myproject\bin\Debug\mydatabase.sqlproj]

@greg84 greg84 added the bug Something isn't working label Feb 13, 2024
@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 13, 2024

@greg84 Maybe you could share your .sqlproj file?

@greg84
Copy link
Author

greg84 commented Feb 13, 2024

Fixed it by removing this line:

<Import Project="Microsoft.Data.Tools.Schema.SqlTasks.targets" />

Sorry, closing this ticket.

@greg84 greg84 closed this as completed Feb 13, 2024
@dzsquared
Copy link
Contributor

Thanks @greg84! You got it - removing the reference to those targets. The Microsoft.Data.Tools.Schema.SqlTasks item correlates to the previous SQL project format, the targets necessary for Microsoft.Build.Sql are automatically included for all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants