DllImport to unmanaged

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default DllImport to unmanaged

    Hello NG

    From a Web Project (C#, XP-box) I want to call unmanaged code :

    so

    [DllImport("mydll.dll", EntryPoint="FirstFunc")]
    private static extern int FirstFunc();

    BUT when I in my C# prog call FirstFunc(), I get "Unable to load dll
    (mydll)"
    I have copied mydll.dll from a to b without success.

    So where should the dll be located and which access-rights should it be
    equiped with?
    (haven't found the rules)


    Thanks,
    flemming



    flemming eriksen Guest

  2. Similar Questions and Discussions

    1. dllimport and web services
      I have an C#/ASP.Net 1.1 Web Service that has an exposed Web Method that uses an unmanaged DLL via the DllImport Attribute. Is one copy of the DLL...
    2. DllImport Error
      Hello friends, I need to load an unmanaged dll(which i wrote for license control) from system32 folder and then my asp. net project will read the...
    3. Unmanaged DLL and ADO
      I have a C# written webservice that calls an unmanaged DLL. The DLL uses ADO to access SQL database. I can call the DLL with no problem from a C#...
    4. DllImport and WebMethod and STAThread
      I'm trying to use a 3rd party DLL, which I have no control over, in my WebService (written in C#). However, every time my WebService tries to call...
    5. unmanaged dll DllNotFoundException
      i have a c++ managed wrapper around unmanaged dll. when i use this wrapper from managed console app it works fine but when i use it in aspx i...
  3. #2

    Default Re: DllImport to unmanaged

    It should be in either the /bin directory or in c:\windows\system32
    directory. You will need to grant the "interop" permission as well as by
    default, web apps cannot access interop code. You can do this via the .Net
    framework configuration inthe policy section, and allow interop for the
    machine group.

    --

    - Paul Glavich
    ASP.NET MVP
    ASPInsider ([url]www.aspinsiders.com[/url])


    "flemming eriksen" <flericsson@kabnosapma.com> wrote in message
    news:O1HQredDFHA.2676@TK2MSFTNGP12.phx.gbl...
    > Hello NG
    >
    > From a Web Project (C#, XP-box) I want to call unmanaged code :
    >
    > so
    >
    > [DllImport("mydll.dll", EntryPoint="FirstFunc")]
    > private static extern int FirstFunc();
    >
    > BUT when I in my C# prog call FirstFunc(), I get "Unable to load dll
    > (mydll)"
    > I have copied mydll.dll from a to b without success.
    >
    > So where should the dll be located and which access-rights should it be
    > equiped with?
    > (haven't found the rules)
    >
    >
    > Thanks,
    > flemming
    >
    >
    >

    Paul Glavich [MVP ASP.NET] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139