473,503 Members | 10,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't call external DLL

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
-----

Any ideas please ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
Dec 3 '05 #1
2 2174
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
"Michael Tissington" <mt*********@newsgroups.nospam> wrote in message
news:ue****************@tk2msftngp13.phx.gbl...
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
-----

Any ideas please ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com

Dec 4 '05 #2
Thanks, my ISP www.hostedasp.net were happy to work with me have have given
me permission to run UnmanagedCode.

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:up****************@TK2MSFTNGP11.phx.gbl...
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
"Michael Tissington" <mt*********@newsgroups.nospam> wrote in message
news:ue****************@tk2msftngp13.phx.gbl...
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
-----

Any ideas please ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


Dec 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2525
by: Richard Speiss | last post by:
I am trying to display a random background image for a webpage. I found this code to do it <% 'Defines the number of background images you have Const NUMBER_OF_IMAGES = 2 'Initiates the...
2
12239
by: Sandeep | last post by:
Hi I have a VC++ ui which has an HTML Container. I have several Javascript functions that need to call functions in VC++ UI. For this , the existing code is using a call "windows.external". What...
0
7126
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE...
8
2399
by: Zheng Da | last post by:
I wrote a simple one as follow: typedef struct __myjmp_buf { int efp; int epc; }myjmp_buf; int mysetjmp(myjmp_buf env) {
1
1485
by: stevo | last post by:
What causes C# to generate code to call the same external DLL 2 different ways? At one point in the app, it calls the entry point like this (disassembled) and it bombs with a null reference:...
2
1831
by: norvinl | last post by:
Hi, I have a textbox on a form. When I assign a string to the .Text property while in my form's constructor, the program just hangs indefinitely. Alternatively, if I assign the string to the...
2
4744
by: PrettySneaky | last post by:
I have bumbed into a frustrating problem with my webservice. When I run he web site in Visual studio 2005 everything works fine. But when i try to publish it, it seems to be unable to call a method...
2
5669
by: Serman D. | last post by:
Hi all, I'm trying to complete the samples from the excellent 2003 developerWorks article "Bringing the Power of Regular Expression Matching to SQL" by Knut Stolze: http://tinyurl.com/3bhrnn...
7
2246
progdoctor
by: progdoctor | last post by:
I have a php web based application with dhtml menu. Each time user click menu Item, the page loads external php page into a div container in that page and then load external javascript as the...
0
1545
by: hsawalhi | last post by:
Hi - How can I invoke web service from ibm web sphere commerce that exist on external server (system). Notes: * I have the wsdl file and xsd files. * I create the SDO " client API". * I...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.