I have a requirement to merge multiple dacpacs into a single dacpac so using the example (http://dacsamples.codeplex.com), when I attempt to build using Microsoft.SqlServer.Dac.Extensions.dll - DacPackageExtensions.BuildPackage() method, I get errors to do with unresolved reference to unnamed objects in various locations. However if I build using VS2015 IDE then I get no such errors, presumably it's the same thing? Any ideas?
Microsoft.SqlServer.Dac.DacServicesException was unhandled
HResult=-2146233088 Message=Cannot save package to file. The model has build blocking errors: Error SQL71501: Error validating element [lr].[Sample]: View: [lr].[Sample] has an unresolved reference to unnamed object. Error SQL71501: Error validating element [lr].[Sample]: View: [lr].[Sample] has an unresolved reference to unnamed object. Error SQL71501: Error validating element [lr].[Sample]: View: [lr].[Sample] has an unresolved reference to unnamed object.
An example of a failing view definition in SQLProj:
CREATE VIEW [lr].[Sample]
AS
--
-- $Id: StressExtract.sql 114559 2015-11-11 18:31:50Z sharsl $
-- $URL: https://svc-vcs-prd:18080/svn/apps/RCLMReporting/branches/TransformationCash/Src/SQL/Cil/lr/Views/StressExtract.sql $
--
-- ====================================================================
--
-- Copyright (c) 2000-2009 by Mizuho International plc.
-- All Rights Reserved.
--
-- ====================================================================
--
-- Purpose: View to display StressExtract view .
--
-- Author: Regulatory ISD
--
--
--
WITH TripartyPrestartOverrides AS
(
SELECT *
FROM
( VALUES
('LiquidAssetBuffer','NonUKGovt','AAA')
) AS Overrides ([Col1],[Col2],[Col3])
)
SELECT *
FROM [lr].[DataExtract] D
LEFT OUTER JOIN TripartyPrestartOverrides O
ON D.[LRSecurityClass] = O.[LRSecurityClass]
AND D.[TransactionStatus] LIKE 'PRESTART%'
AND D.[ProductType] = 'TRIPARTYREPO'
WHERE ([ExclusionFlag] = 'N' OR [DataGroup]='Ledger' OR [BookRef]='SCA/OTHER')
GO