Richard Hallgren


Hi!

From the dll I've installed in SQL Server I load a dll via reflection.assembly.load from the GAC . I know the dll can load the dll when I test it outside SQL Server but when I run it via a store procedure from within the SQL Server I keep getting a System.IO.FileNotFoundException.

How does this work Isn't all dll in the GAC loaded by SQL Server Is this impossible to achieve

Thanks in advance

Richard Hallgren





Re: A third dynamic assembly loading problem ;)

nielsb


There are only a sub-set (13 or something like that, all of them system assemblies) of assemblies that are allowed to leaded from the GAC inside of SQL Server. No user assemblies are allowed to be loaded from the GAC.

So what you need to do is to catalog the assemblies you want to load dynamically in the database, and it should work.

Niels





Re: A third dynamic assembly loading problem ;)

Richard9677

Thanks Niels!

But the dependency tree for the assemblies I like to reference is kind of big and guess I have to catalog all of those as well (that is the assemblies that the assembly I like to reference depend on). Some of them contains unmanaged code as well but I guess as long as I set the unsafe permission mode on those I should be able to catalog those as well. Right






Re: A third dynamic assembly loading problem ;)

nielsb

Richard Hallgren wrote:

But the dependency tree for the assemblies I like to reference is kind of big and guess I have to catalog all of those as well (that is the assemblies that the assembly I like to reference depend on). Some of them contains unmanaged code as well but I guess as long as I set the unsafe permission mode on those I should be able to catalog those as well. Right

You basically need to catalog all assemblies that will be loaded, either directly or indirectly.

Niels