A SQL Server Data Tools (SSDT) solution that has been used for several years includes multiple database projects, some referencing the master database and/or using [sys] tables in other referenced database projects within the same solution. This solution was configured with database references and functioned properly in VS 2019.
For example, the [MAIN_CODE] (db project) has stored procedures that reference [$(DATA01)].[sys].[tables] in the [DATA01] (db project) and/or [msdb].
After upgrading to VS 2022 Professional, the following error occurs: "71562: Unresolved reference to object [$(dbVariable)].[sys].[objects]." This error appears for all references to other database projects that refer to the [sys] schema, presumably those related to the [master] or [msdb] databases.
- Attempts to resolve the issue, including removing and re-adding references, restarting Visual Studio and the PC, switching to INFORMATION_SCHEMA tables (which is not feasible due to references to [sys].[indexes]), and changing the target platform back to SQL 2019 with re-added references, have not been successful.
- Additionally, creating a new .dacpac in the respective databases from a SQL 2022 server's [master] database and replacing it in the VS folder, as well as creating a new SSDT project named [master] and importing the existing .dacpac (which has encrypted/hidden object definitions), did not resolve the issue.
It appears that VS 2022 SSDT does not resolve projects' [sys] schema or objects correctly.