Reputation: 1
I have problem with adding assembly dll in SQL Server 2014. I try to create assemble stored procedure like this
CREATE ASSEMBLY pdf_create FROM 'dll path\test.dll' WITH PERMISSION_SET = SAFE
SQL Server returns this error:
Assembly 'test' references assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', 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: 2(Не удается найти указанный файл.)). Please load the referenced assembly into the current database and retry your request.
Help please if you have any ideas
Upvotes: 0
Views: 389
Reputation: 1698
So the question is why you would need a dependency on system.drawing.dll
in an SQLCLR assembly? I would look at the code for the test.dll
, and try to get rid of that particular dependency.
What you can do, if you absolutely need to include system.drawing.dll
, is to copy it and put it in the same directory as the dll you try to create the assembly from, as SQL Server automatically creates assemblies from dependent assemblies if they are in the same path.
However, if you do that, then you probably need to change the permission set for the assembly you create as (if I remember correctly) system.drawing.dll
needs a lesser permission set than SAFE
.
So all in all, try to get rid of the dependency, you save yourself a lot of trouble that way.
Upvotes: 1