CLR Assembly redeploy problem

  • I have created a C# library containing CLR stored procedures and user-define functions using Visual Studio 2005, and I have used Visual Studio to deploy the assembly to a SQL Server 2005 instance successfully, of course these sps and udfs are used by other T-SQL sps and udfs. Now the assembly has a new version, and I want to use it to replace the original one, but when I use Visual Studio 2005 to deploy the new assembly, the following error occurs:

    Error1Cannot drop the function 'TranslationStringLike', because it does not exist or you do not have permission.

    Cannot drop the function 'TranslateEngString', because it does not exist or you do not have permission.

    Cannot drop the function 'TranslateEngStringReverse', because it does not exist or you do not have permission.

    DROP ASSEMBLY failed because 'FirmBankCLR' is referenced by object 'TranslationStringLike'.FirmBankCLR

    That is the assembly is dependent by other objects, it can’t be dropped until it is not dependent by other objects. How can I resolve this problem using Visual Studio 2005 or something else?

  • This is a common problem with CLR assemblies.

    Instead of dropping the assembly, you could try to alter it. (also have a look at the UNCHECKED DATA option for the alter assembly)

    Concerning the dependent objects, when you use alter assembly, and it can proceed (the changes to method signatures are not too horrible), the dependent objects do not need to be dropped/created again.

    BTW, the dependent objects that Visual Studios deployment script is trying to drop, do they exist? are you allowed to access them?

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Yes, they exsit and I am the owner of the database.

  • Actually, 'TranslationStringLike', 'TranslateEngString', 'TranslateEngStringReverse' are udfs contained in the FirmBankCLR aseembly, and they are used by other sps and udfs.

  • The WITH UNCHECKED DATA option works, but I should use the DROP FILE ALL option to remove related source files first.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply