ASP.NET App with Unmanaged Code - HELP!

T

Ted

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
 
K

Kaustav

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,833
Latest member
BettyeMacf

Latest Threads

Top