473,657 Members | 2,504 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 .SecurityExcept ion:
System.Security .Permissions.Se curityPermissio n
-----

Any ideas please ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
Dec 3 '05 #1
2 2200
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*********@ne wsgroups.nospam > wrote in message
news:ue******** ********@tk2msf tngp13.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 .SecurityExcept ion:
System.Security .Permissions.Se curityPermissio n
-----

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********@hot mail.com> wrote in message
news:up******** ********@TK2MSF TNGP11.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*********@ne wsgroups.nospam > wrote in message
news:ue******** ********@tk2msf tngp13.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 .SecurityExcept ion:
System.Security .Permissions.Se curityPermissio n
-----

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
2541
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 randomize function Randomize
2
12254
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 I am unable to link is the fact that upon calling windows.external , why a C++ UI is called and not something else. I want to understand that if I call windows.external from a js, how is the function call resolved.
0
7137
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 TRIGGER statement.) I've also defined a SQL stored proc, and the trigger is set to call this SP. I've posted the simplified source below. I can manually call the stored proc, and the external trigger is created without any errors. However, when I do...
8
2410
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
1491
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: 00000064 call dword ptr ds: At another point in the same app, it calls the exact same entry point like this and it works: 00000051 call 00A5B073
2
1838
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 form's .Text property, it works fine. this code hangs (never returns from 3rd line):
2
4760
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 from an external dll file. When I mean external dll file I simply mean it's dll which I have not written and I use as an reference (not a web reference) in my VS solution. When I call my webservice from my javascript code that callback...
2
5706
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 I've managed to compile and link the C code from "Listing 5", the regexpSimple() wrapper (see link). The build options are pretty much
7
2251
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 clientside event handler of that loaded page.I load both of them using ajax method. The problem is: how to call a function of that external javascript soon after the external javascript file loaded into main page? I tried eval(functionName()) but it...
0
1550
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 need to call web service using JAVA code (not and soap request). * optional how can call web service from external server using websphere MQ.
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7354
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
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 we have to send another system
2
1971
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.