question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dotnet build issue with system database reference.

See original GitHub issue
  • SqlPackage or DacFx Version:0.1.3-preview
  • .NET Framework (Windows-only) or .NET Core:.NET Core
  • Environment (local platform and source/target platforms): Windows

Steps to Reproduce:

  1. Create a new database project in Visual Studio
  2. Follow instructions in this blog to get build working with dotnet build. https://erikej.github.io/ssdt/dotnet/2022/03/07/ssdt-dacpac-netcore.html
  3. Build should work at this point. dotnet build /p:NetCoreBuild=true
  4. Add a reference to the “master” system database in Visual Studio. This creates the following XML:
<ItemGroup>
    <ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
      <HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac</HintPath>
      <SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
      <DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
    </ArtifactReference>
  </ItemGroup>
  1. Build will now fail. dotnet build /p:NetCoreBuild=true

C:\Users\user1\.nuget\packages\microsoft.build.sql\0.1.3-preview\tools\netstandard2.1\Microsoft.Data.Tools.Schema.SqlTasks.targets(525,5): Build error SQL72027: File “C:\Users\user1\.nuget\packages\microsoft.build.sql\0.1.3-preview\tools\netstandard2.1\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac” does not exist. [c:\Git\TrimbleOSS\dba-dash\Database1\Database1.sqlproj]

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

Not applicable to prior version

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
dzsquaredcommented, Mar 22, 2022

@kisantia Kim Santiago FTE Do you get the good table designer experience in ADS? Do you get model validation with Intellisense in ADS?

@ErikEJ to be clear, this wasn’t to suggest that Visual won’t get support for the SDK-style project file, but currently an optional workaround is to use Azure Data Studio insiders (or the command line option shared above).

1reaction
zijchencommented, Feb 15, 2023

We just released 3 system dacpac Nuget packages that can be referenced via PackageReference from projects built with Microsoft.Build.Sql 0.1.9-preview and up. Example:

<PackageReference Include="Microsoft.SqlServer.Dacpacs" Version="160.0.0" />

Available packages are:

You can read more about it here: https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/sql-database-project-extension-sdk-style-projects?view=sql-server-ver16#package-references

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot .NET Framework targeting errors
In this article ... This topic describes MSBuild errors that might occur because of reference issues and how you can resolve those errors....
Read more >
dotnet build does not see referenced project
Create net461 Core webproject referencing ClassLibrary of same 4.6.1 ... NET.Sdk\build\Microsoft.NET.Sdk.targets(92,5): error : Cannot find ...
Read more >
Troubleshoot broken references - Visual Studio
To fix this problem, use one of the following methods: Delete the broken reference and then replace it by using the Add Reference...
Read more >
VS 2019 database project build errors on SQL view that ...
When building the database project VS 2019 errors on a view that contains any sys.* references. The work around is to go to...
Read more >
Reference to system databases becomes duplicated in ...
In a huge SSDT database solution with lots of projects and references, I'm adding a reference from my project to system databases(master, msdb), ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found