I am trying to add a DLL into SQL Server:
CREATE ASSEMBLY ClassLibrary1
AUTHORIZATION dbo
FROM 'C:\Debug\ClassLibrary1.dll'
WITH PERMISSION_SET = UNSAFE
GO
As you can see here my DLLs
But I get this error:
Assembly 'System.Threading.Channels' references assembly 'system.threading.tasks.extensions, version=4.2.0.0, culture=neutral, publickeytoken=cc7b13ffcd2ddd51.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request.
Why am I getting this error when all the referenced DLLs are available?
Hmm, interesting - the way you create the assembly the extensions dll should automatically have been created.
Couple of things:
There are reasons why some dll's are very difficult to deploy into the db - so maybe ask yourself whether you can accomplish what you want to do with your dll, from outside the db. Every time I see dll's referencing System.Threading, and System.Memory I get worried.
Oh, I see what you want to do - you want to call out to Rabbit, and I assume you are using one of the latest rabbit client dll's. I have a vague recollection that the later dll's cannot be deployed to SQL. I actually wrote a blog post about how to do this back in 2017. Have a look at the post, and see if it helps you.