I made some library and want to use it as CLR assembly in MSSQL. The point is that my lib have the reference to 'iAnywhere.Data.SQLAnywhere' lib which I cannot install. The error is:
Assembly 'iAnywhere.Data.SQLAnywhere' could not be installed because existing policy would keep it from being used.
I have implemented the recommendations and now my SQL looks like:
USE DB_Control
GO
ALTER DATABASE DB_Control SET TRUSTWORTHY ON WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE DB_Control SET TRUSTWORTHY ON
GO
exec sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
exec sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO
CREATE ASSEMBLY [iAnywhere.Data.SQLAnywhere]
AUTHORIZATION sa
FROM '~\Debug\iAnywhere.Data.SQLAnywhere.dll'
WITH PERMISSION_SET = UNSAFE
GO
CREATE ASSEMBLY ClrSqlMediator
AUTHORIZATION sa
FROM '~\Debug\SQLMediator.dll'
WITH PERMISSION_SET = UNSAFE
GO
Does anybody know how to fix this?
Upd: Server version is SQL Server 2008 R2 (x64). My MediatorCLR built as x64 lib, but I almost shure SQLAnywhere.dll built as x86. Can it be the reason?
Upd2: Here is Dropbox link to libs: x64 - https, x86 - https.
Upd3: I start thinking that SQLAnywhere.dll cannot be loaded at all because of x86 build option and I'm not sure that it has public static methods that is required. Surely i got to implement some other kind of reference.