I\'ve created a UDF that accesses the [INFORMATION_SCHEMA].[TABLES] view:
CREATE FUNCTION [dbo].[CountTables]
(
@name sysname
)
RETURNS INT
what Sam said is the best way for doing this.
However, if you have a scenario that you need to deploy the dacpac from a machine that doesn't have that reference in that specific location, you may get into trouble.
Another way is to open your .project file and make sure the following tag has the value of false for the build configuration you are trying to run.
false
This way you don't need to add a reference to your project.