Can't call external DLL

  • Thread starter Michael Tissington
  • Start date
M

Michael Tissington

I have converted an application to asp.net 2.0.

a C# file in my App_Code folder calls a C++ DLL that is in my BIN folder.

In the previous version of .NET this worked correctly. However in a hosted
environment I'm now getting a a security error when I try to call the
external dll.

---
Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException:
System.Security.Permissions.SecurityPermission
 
R

Rick Strahl [MVP]

Hi Michael,

You probably don't have permissions to access the DLL and execute native
code with your ISP. You should check what permission set your app is running
under at your ISP - to get at the DLL you will need full trust (which is the
default but just to be sure).

You also should check what account your app is running under and what OS
permissions your DLL might need to do whatever it is doing. If it's reading
files or accessing the registry etc. it may not work since you'll be running
under a fairly limited account that likely has no rights outside of the
immediate directory your app is running in.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top