Assembly files and object existence checks

pblackpblack Posts: 2 New member
Trying to re-run a deployment generated with add object existence checks checked and receieving the error message The associated file "CLR.Helpers.pdb" already exists for assembly "CLR.Helpers". 

The generated script does detect if the assembly exists but it does not check that the pdb file has been added.
Hence the error.

I have manually added in the line 
IF NOT EXISTS(SELECT * FROM sys.assembly_files AS af WHERE af.name = 'CLR.Helpers.pdb') and this works.  Is this a bug or am I missing an option.
Tagged:

Best Answer

  • Alex BAlex B Posts: 1,157 Diamond 4
    Hi @pblack,

    It looks like we handle the existence check for the extra files when that is the only change:
    IF NOT EXISTS(SELECT 1 FROM sys.assemblies join sys.assembly_files ON sys.assemblies.assembly_id = sys.assembly_files.assembly_id WHERE sys.assemblies.name = N'HelloWorld' AND sys.assembly_files.name = N'C:\Users\alex.bartley\source\repos\HelloWorldClr\HelloWorldClr\bin\Debug\HelloWorldClr.pdb')
    ALTER ASSEMBLY [HelloWorld]
    ADD FILE FROM ...

    but when the assembly is being created as well, the existence check for the assembly is there, but the one for the file is missing.

    This looks like an existing issue with reference SC-6380 and I have updated it with your occurrence, but unfortunately the issue is currently in the backlog and does not look like it will be done in the near to mid term at least.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?

Answers

  • Hi Paul,

    I'm pleased to report that the team were actually able to get this implemented.  The fix for this is now available in SQL Compare 14.1.2 which was just released today.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.