Monday, February 16, 2009

Security.dll

I was getting a funky error when trying to call one of my WCF web service’s methods:

Unable to find an entry point named 'FreeCredentialsHandle' in DLL 'security.Dll'.

Fortunately my brain is working this morning and I remembered the last time I saw this kind of odd error. Looking in the bin directory of the web site, sure enough I see a dll called security.dll. Ruhroh… IIS kindly loads up any dlls that you ask it to, then when it tries to access the Microsoft Security.dll it seems to find your dll and routes calls into it. These entry points (normally) don’t exist hence the error.

The moral of the story is: Do not call your dll security.dll*.

I just went through the whole project and made sure that the outputs were called something useful like Company.Project.Thing.dll. You do need to restart the web server too so it will reload the (correct) Security.dll.


* Other bad names are probably things like System.dll, mscorlib.dll etc. A much better idea is to create a proper namespace for your code and make the assembly name something like the namespace – or even the whole namespace, why not? Knock yourself out.

1 comment:

  1. Wooow thanks da5id! :) thats solved my problem. what a stupid error!!!!!

    ReplyDelete