-
Notifications
You must be signed in to change notification settings - Fork 25
Description
- SqlPackage or DacFx Version: SSDT 16.0.62205.05200
- .NET Framework (Windows-only) or .NET Core: 4.8 / 3.1
- Environment (local platform and source/target platforms)
- Windows 10
- VS 2019 16.11.26
DacFx shows warnings about unresolved references to ServiceBroker services and/or contracts if they are variables in a statement. Using variables in mentioned places is a valid syntax, warnings smell like false-positive.
They cannot be fixed (unless rewritten into hardcoded links to services and contracts existing in the project) thus we have to disable such warnings on specific files so we can keep enabled option "Treat warnings as errors" on the whole project.
Steps to Reproduce:
- Include into sqlproj a stored procedure with
BEGIN DIALOG CONVERSATIONstatement - Replace service and contract links with variables (which is a valid syntax)
- See warnings about unresolved references
Sample code:
CREATE PROCEDURE dbo.SendOnConversation
AS
BEGIN
DECLARE
@Handle UNIQUEIDENTIFIER
, @SourceService VARCHAR(128)
, @TargetService VARCHAR(128)
, @ContractName VARCHAR(128);
-- some code with variable initialization --
BEGIN DIALOG CONVERSATION @Handle
FROM SERVICE @SourceService
TO SERVICE @TargetService
ON CONTRACT @ContractName
WITH
LIFETIME = 604800
, ENCRYPTION = OFF;
END;
Note, it does not show warning on target service link which is a variable as well.
Did this occur in prior versions? If not - which version(s) did it work in?
no such version
PS
Speaking of SDK-style projects: if this is not fixed then one'd still have to mention all such files in the .sqlproj to put <SuppressTSqlWarnings>71502</SuppressTSqlWarnings> for hiding warnings purpose.
(DacFx/SqlPackage/SSMS/Azure Data Studio)
