Visual C# Developer Center >
Visual C# Forums
>
Visual C# Language
>
Cannot use DLL library in my code
Cannot use DLL library in my code
- Hi,
I just downloaded the C5 collections library to use in one of my projects. I downloaded the DLL version of the library, and have add a reference to it to my project. However, whenever I try to use the DLL, I get this error:
System.Security.SecurityException: That assembly does not allow partially trusted callers.
I haven't been able to get rid of this error. As far as I know, all of my code should be running in full trust mode. Does anyone have any ideas?
Thanks!
Answers
- I tried a few things and wasn't able to get the dll working. I finally ended up just downloading the source and compiling the dll myself, after which it worked fine.
- Marked As Answer byxslaugh Wednesday, November 04, 2009 4:13 PM
All Replies
- Are you running the application on a network or from the local system?
Ganesh Ranganathan
[Please mark the post as answer if it answers your question]
blog.ganeshzone.net - Everything is running locally.
- Check the documentation associated with the library.
It seems that you might need to add some security attributes to your code.
Mark the best replies as answers. "Fooling computers since 1971." Try registering your DLL. Use the following command (RegSvr32) in command prompt.
Usage: regsvr32 [/u][/s][/n][/i[:cmdline]] dllname
/u - Unregister server
/s - Silent; display no message boxes
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall
/n - do not call DllRegisterServer; this option must be used with /i
Balaji Baskar
[Please mark the post as answer if it answers your question]- xslaugh,
Are you still having problems?
Mark the best replies as answers. "Fooling computers since 1971." - I tried a few things and wasn't able to get the dll working. I finally ended up just downloading the source and compiling the dll myself, after which it worked fine.
- Marked As Answer byxslaugh Wednesday, November 04, 2009 4:13 PM


