Accessing a non-DotNet assembly from an ASP.Net application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Here is my scenario: I have a Distances class that contains a
GetDistanceFromCities method. This method makes a call to an external 3rd
party non-.net asembly (miles32.dll). Everything works propery when I
instantiate the class from a command line app and call the method, but when I
call the same thing from my ASP.Net Web Service the call fails. It doesn't
throw an exception, it just fails to return a valid result (as if it can't
access the other associated assemblies that came with miles32.dll).

My first hunch was that it was security related, so I tried impersonation
in the code, but that had no effect.

So do I have to add machine.config entries to trust this assemble? Do I
have to add the path to the aseembly in the environmental variables somewhere?

I'm at a loss, any suggestions would be greatly appreciated.

thanks,
-James Divine
(e-mail address removed)
 
Hi Sharon,

This call is being made from a Web Service, so I have no UI (and thus no
page directives). Is there another way I can toggle the ASPCOMPAT property?

-James
 
Add [STAThread] attribute on the class
or the method that is making the call to the com object.
Sharon.
 

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

Back
Top