Skip to content

SDK Style projects fails to build project which has a project dependency, on unresolved references #580

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

Open
meni-braun opened this issue Mar 5, 2025 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@meni-braun
Copy link

  • SqlPackage or DacFx Version: <Sdk Name="Microsoft.Build.Sql" Version="1.0.0-rc3" />
  • .NET Framework (Windows-only) or .NET Core: .NET Core 8
  • Environment (local platform and source/target platforms): Local .NET Core 8 using dotnet build

Steps to Reproduce:

  1. Create A.sqlprojx with a SQL table dbo.MyTable and CREATE SCHEMA [Test] AUTHORIZATION [dbo] and 2 types:
    CREATE TYPE [Test].[MyAccounts] AS TABLE (
    AccountName varchar(200)
    )
    GO
    
    CREATE TYPE [dbo].[MyEmails] AS TABLE (
    Email varchar(100)
    )
  2. Create B.sqlprojx with multiple stored procedure to query that table, and some getting as parameter of one of the types above, and add a project reference to project A.sqlproj
  3. Build project B.sqlprojx with dotnet build B.sqlprojx
  4. The build fails with following errors:
    • Build error SQL71501: Parameter: [dbo].[MyFailingQuery1].[@myvalues] has an unresolved reference to Built-in Type [Test].[MyTest].
    • Build error SQL71501: Parameter: [Test].[MyFailingQuery6].[@myvalues] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects:

Did this occur in prior versions? If not - which version(s) did it work in?
SQL project with reference to another project used to work, similar to these simplified ones, used to work on the original SSDT SQLproj format.

Created a small test project, demoing the issue: TestSqlProjx.zip

(build sdk)

Please advise!
Thank you!

@meni-braun meni-braun added the bug Something isn't working label Mar 5, 2025
@zijchen
Copy link
Member

zijchen commented Mar 5, 2025

It seems like project references aren't working with .sqlprojx extension, if you change the projects to .sqlproj they should work.

@meni-braun
Copy link
Author

Thank you @zijchen ! That was the issue!

Image

Maybe reconsider repurposing this bug to fix the docs, which say that you need to rename the project extension to .sqlprojx, which I confused as a prerequisite for Visual Studio and dotnet command line.

@dzsquared dzsquared added the documentation Improvements or additions to documentation label Mar 7, 2025
@dzsquared dzsquared self-assigned this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants