473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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



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
di*****@wausauhomes.com
Mar 24 '06 #1
3 1555
Try adding ASPCOMPAT="TRUE" to the page directive.
Also this page may help:
http://support.microsoft.com/default...b;en-us;308095
Sharon.
"trent dudei" <tr********@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...


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
di*****@wausauhomes.com

Mar 24 '06 #2

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

"Sharon" wrote:
Try adding ASPCOMPAT="TRUE" to the page directive.
Also this page may help:
http://support.microsoft.com/default...b;en-us;308095
Sharon.
"trent dudei" <tr********@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...


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
di*****@wausauhomes.com


Mar 24 '06 #3
Add [STAThread] attribute on the class
or the method that is making the call to the com object.
Sharon.
"trent dudei" <tr********@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com...

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

"Sharon" wrote:
Try adding ASPCOMPAT="TRUE" to the page directive.
Also this page may help:
http://support.microsoft.com/default...b;en-us;308095
Sharon.
"trent dudei" <tr********@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
>
>
> 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
> di*****@wausauhomes.com


Mar 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: sachin_mzn | last post by:
Hi, Why I am not getting any run time error while accessing a freed memory in following code. This is printing h in std output. #include<stdio.h> main() { char* buffer = (char*)malloc(6);...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
8
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide...
1
by: mark kurten | last post by:
i have a asp.net site that is causing problems for users accessing it using a proxy server. does anyone know of any limitations the proxy might have? or anything else that would effect the proxy...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: tmanikandaraja | last post by:
I want to have a clarification on some data access scenarios with DB2 as data source I have CICS modules accessing DB2 currently with embedded functional logic and they do non-atomic...
15
by: Bob | last post by:
Is there anyway to access the global object from inside a function other than doing a "var _global = this;" before declaring the function? Thanks
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
6
by: Bhawna | last post by:
I am into c++ code maintenance for last 3-4 years but recently I am put into design phase of a new project. Being a small comapany I dont have enough guidance from seniors. Currently I am into a...
16
by: s0suk3 | last post by:
This code #include <stdio.h> int main(void) { int hello = {'h', 'e', 'l', 'l', 'o'}; char *p = (void *) hello; for (size_t i = 0; i < sizeof(hello); ++i) {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.