HighTechTalks DotNet Forums  

Using a DLL in a web service

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss Using a DLL in a web service in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Using a DLL in a web service - 03-20-2006 , 01:53 AM






Hi guys,
I'm trying to use a DLL of third part using P/Invoke in a web service.
I've always an exception: access denied.

The DLL is in the bin directory of the project.
I'm using VS .NET 2003, WSE 2.0 and .NET Framework 1.1. I'm trying the
code using the address http://loalhost/webservice and the test link.

I've tried the same code with a Windows Forms program without any
problem !

Could someone help me ?

Thank you in advance.
Best regards
dB


Reply With Quote
  #2  
Old   
Josh Twist
 
Posts: n/a

Default Re: Using a DLL in a web service - 03-20-2006 , 04:50 AM






The problem will be permissions - when you're a running a windows form
project the application is running with the permissions of the current
logged in user (often an admin if they're a developer).

However, when the application is a web application it is running as the
ASPNET user account which has much fewer permissions.

Your code will need access to the UnmanagedCode permission. These
articles and the links under 'Further Reading' should help.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlksecuritytutorial.asp
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx

Naturally, be careful not to give away permissions too freely. Keep
things as locked down as you possible can.

Josh
http://www.thejoyofcode.com/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.