ASP.NET App with Unmanaged Code - HELP!

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

  1. #1

    Default ASP.NET App with Unmanaged Code - HELP!

    I think the following is a security configuration issue, can someone help?
    I've been stumped on this for a couple of days now and I'm feeling the heat
    at work.

    --

    I'm using a 3rd party ActiveX control which has it's own constructor and two
    very simple methods (which ultimately sends out messages on the server's USB
    port). I am trying to run this ActiveX component in my ASP.NET applicaiton.
    For now, I'm testing this application via *localhost* connection, but will
    eventually go to a client/server domain.

    At first, within the Page_Load method, I successfully instantiate it using
    the constructor -- no exceptions caught:
    try
    {
    oABC = new ABCClass();
    Response.Write("oABC object was created");
    }
    catch ..

    Later, upon a button press, I try to use the method(s) within oABC -- again,
    it appears everything works - no exceptions caught:
    try
    {
    Object err;
    err = oABC.Method1( "xxx", "xxx", null, null);
    Response.Write("Method1 Succeeded - err = " + err.ToString());
    }
    catch ...

    *BUT*, Method1 doesn't appear to send out a USB message.

    *HOWEVER*, Method1 works fine in console C# app called directly from the
    command line or if I surf to a VBScript/HTML file with the method call,
    which presumably uses the ActiveX on the client's IE container. In both of
    these cases the USB port receives/sends the messages.

    Right now, IIS is running Anonymous Authentication (though Windows
    Authentication is also checked in the dialog box), ASP.NET is running
    Windows Authentication. Impersonation is not set (default=false). No
    application identities set. Also, I have no CAS settings assigned. I think
    this means that the calling process would be System process -- shouldn't
    this have all the rights required?

    If the unmanaged code is accessing files, I/O, etc. does the calling
    assembly need to provide access?

    Any recommendations?

    Ted


    Ted Guest

  2. Similar Questions and Discussions

    1. Invoke from unmanaged code
      Hi, It is possible to invoke the web service from Embedded Visual C++? If yes, how?
    2. Access File Share from ASP.NET using Unmanaged Code
      Hi, We have an application that requires appropriate users to run command files on an adhoc basis. We have implmented a library that uses the...
    3. Calling web service from unmanaged code
      I don't know if this works in unmanaged code, but in managed code you can use the URL property of the proxy web service class for this. Alternativly...
    4. Web Services and Unmanaged Code
      Hello, We are new in the .NET environment, and we have a working web app under Windows environment. I'm building a .NET Web Service in C#,...
    5. Security problem with Managed Code calling Unmanaged Code in a Web Page
      Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and...
  3. #2

    Default RE: ASP.NET App with Unmanaged Code - HELP!

    Hi Ted,

    use impersonation and your code should work. By default ASPNET account has
    the least privileges and hence pretty often it is not able to execute various
    methods which are otherwise possible when you are using a Console App or a
    Winforms App since then such applications are running on the Security Context
    of the logged in user.

    HTH.

    Kaustav Neogy.

    "Ted" wrote:
    > I think the following is a security configuration issue, can someone help?
    > I've been stumped on this for a couple of days now and I'm feeling the heat
    > at work.
    >
    > --
    >
    > I'm using a 3rd party ActiveX control which has it's own constructor and two
    > very simple methods (which ultimately sends out messages on the server's USB
    > port). I am trying to run this ActiveX component in my ASP.NET applicaiton.
    > For now, I'm testing this application via *localhost* connection, but will
    > eventually go to a client/server domain.
    >
    > At first, within the Page_Load method, I successfully instantiate it using
    > the constructor -- no exceptions caught:
    > try
    > {
    > oABC = new ABCClass();
    > Response.Write("oABC object was created");
    > }
    > catch ..
    >
    > Later, upon a button press, I try to use the method(s) within oABC -- again,
    > it appears everything works - no exceptions caught:
    > try
    > {
    > Object err;
    > err = oABC.Method1( "xxx", "xxx", null, null);
    > Response.Write("Method1 Succeeded - err = " + err.ToString());
    > }
    > catch ...
    >
    > *BUT*, Method1 doesn't appear to send out a USB message.
    >
    > *HOWEVER*, Method1 works fine in console C# app called directly from the
    > command line or if I surf to a VBScript/HTML file with the method call,
    > which presumably uses the ActiveX on the client's IE container. In both of
    > these cases the USB port receives/sends the messages.
    >
    > Right now, IIS is running Anonymous Authentication (though Windows
    > Authentication is also checked in the dialog box), ASP.NET is running
    > Windows Authentication. Impersonation is not set (default=false). No
    > application identities set. Also, I have no CAS settings assigned. I think
    > this means that the calling process would be System process -- shouldn't
    > this have all the rights required?
    >
    > If the unmanaged code is accessing files, I/O, etc. does the calling
    > assembly need to provide access?
    >
    > Any recommendations?
    >
    > Ted
    >
    >
    >
    Kaustav 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