I got the following error when I try to deploy my DLL which references other ThirdPartyDLL.
Msg 10300, Level 16, State 2, Line 4
Assembly 'MYDLL' references assembly 'ThirdPartyDLL, version=300.1.0.1, culture=neutral, publickeytoken=5c915cbb2b8fbc32.', 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.
I used this statemant to deploy my dll:
USE MYDATABASE
GO
CREATE ASSEMBLY MYDLL
FROM 'C:\Program Files (x86)\MYDLL\MYDLL.dll'
WITH PERMISSION_SET = UNSAFE;
Go
I'm sure the ThirdPartyDLL is correctly installed but I get the error base on mismatching!!! For example result of this:
SELECT *
FROM sys.assemblies AS a
INNER JOIN sys.assembly_files AS f ON a.assembly_id = f.assembly_id
FOR JSON PATH
is:
Notice:
I was able to register MYDLL on the following version of SQL Server:
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (Intel X86) Jun 17 2011 00:57:23 Copyright (c) Microsoft Corporation Standard Edition on Windows NT 6.1 (Build 7601: Service Pack 1) (WOW64) (Hypervisor)