Did you reference an x86 assembly on a 64 bit server? Take a look at the thread "SQL Server “version, culture or public key mismatch” during “create assembly” when loading XMLSerializers created with sgen utility".
Error during the registration of a CLR assembly in SQL Server 2017 which references other assembly
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 statement to deploy my dll:
I'm sure the ThirdPartyDLL is correctly installed but I get the error base on mismatching!!! For example result of this:
is:
1 additional answer
Sort by: Most helpful
-
m 4,271 Reputation points
2020-08-27T05:52:54.61+00:00 Hi @Anonymous ,
Try code as next:
ALTER DATABASE [xxxx] SET TRUSTWORTHY ON; sp_configure 'clr enabled', 1; RECONFIGURE; CREATE ASSEMBLY [xxxx] AUTHORIZATION [xxxx] FROM 'C:\CLR\MyAssembly.dll' WITH PERMISSION_SET = SAFE
More information: https://dba.stackexchange.com/questions/12479/3rd-party-dll-in-sql-server-clr , https://www.sqlshack.com/impact-clr-strict-security-configuration-setting-sql-server-2017/
BR,
Mia
If the reply helped, please do “Accept Answer”.