Using a DLL in a web service

Discussion in 'ASP .Net Web Services' started by d.barile@gmail.com, Mar 20, 2006.

  1. Guest

    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
     
    , Mar 20, 2006
    #1
    1. Advertising

  2. Josh Twist Guest

    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/d...ry/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/
     
    Josh Twist, Mar 20, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    9,000
  2. hocho888
    Replies:
    1
    Views:
    681
  3. Not Me
    Replies:
    1
    Views:
    3,228
    Not Me
    Jun 5, 2007
  4. Leo Violette
    Replies:
    0
    Views:
    1,099
    Leo Violette
    Apr 17, 2009
  5. H. Simpson
    Replies:
    4
    Views:
    343
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page