473,473 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET and COM interop/security issue.. ('NullReferenceException')

hi All,
I'm trying to call a COM component written in PowerBuilder from an
ASP.NET application. The first method call into the COM component (developed
using PB) is failing with 'Object reference not set to an instnace of an
object' error.
Observations:
1. I can call the same PB COM component from a .NET Windows application
successfully.
2. I can call another COM component (developed using ATL COM, MSVC 6.0)
from the ASP.NET application.
3. I'm using exact same code in the .NET Windows app and in the ASP.NET
app.

Versions:
IIS 6.0, MS Visual Studio 2003 (with .NET Framework 1.1)

Here's the code snippet:
.................
// COClass_n_genappClass is a COM component developed using PowerBuilder
// This code works fine if called in a .NET Windows application
// but thorws an exception when called in a ASP.NET application.
private void Button1_Click(object sender, System.EventArgs e)
{
COClass_n_genappClass obj1 = new COClass_n_genappClass();
short n1 = short.Parse(TextBox1.Text);
short n2 = short.Parse(TextBox2.Text);
short n3 = obj1.add(n1,n2); // This line throws 'NullReferenceException'
in ASP.NET
TextBox3.Text = n3.ToString();
}

// CppCOMObj1Class is a COM component developed using C++/ATL/MSVC6.0
// This code works fine in both ASP.NET and in .NET Windows Application
private void Button2_Click(object sender, System.EventArgs e)
{
CppCOMObj1Class obj1 = new CppCOMObj1Class();
TextBox3.Text =
obj1.TestAdd(short.Parse(TextBox1.Text),short.Pars e(TextBox2.Text)).ToString();
}

I tied the following:
1. Assuming this to be some error related to permission/file access, I
ran NTFileMonitor (sysinternals.com) to make sure that all the files/dlls
can be accessed and loaded.
2. Under the same assumption, I upgraded the Anonymous user a/c
(IUSR_<machine name>) and the ASPNET account to be a part of the
'Administrators' group in the development machine. This is just for
troubleshooting purpose, the accouts needs to me restricted once I figure
out the interop problem.
3. I changed the impersonate setting in machine.config from
<identity impersonate="false" userName="" password=""/>
to
<identity impersonate="true"/>
and,
from comImpersonationLevel="Impersonate" to
comImpersonationLevel="Anonymous"

Could you please help me troubleshooting this issue.
Thanks in advance for all your support.
Mar 7 '06 #1
1 1705
Hi Subrata,

I have replied to you in the COM Interop newsgroup.
You may go and take a look.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 8 '06 #2

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

Similar topics

17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
1
by: Matt Dinovo | last post by:
I have a remoting server that is on the same local box as a COM+ managed object with Library Activation. When I try to activate the object from the remoted assembly, I get the following error: "The...
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
6
by: Andrew Connell | last post by:
Using Interop, I created an assembly DLL that implements some of the methods within the COM DLL. In a WinForm app, it works great. But when I try to implement it in ASP.NET, I get the following...
2
by: Jas Manghera | last post by:
Hello everyone, Im having a rather strange problem with my custom ASP.NET application. After deploying the application on a .NET v1.1 computer, the first time the application is launched it can...
0
by: MarkD | last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via Interop. The DLL uses functionality contained in a Custom OCX Control (Also VB6) that in turn contains a standard TreeView...
5
by: Peter Ritchie [C# MVP] | last post by:
I've purposely been ignoring a CA2122 warning in some C++ interop code I've been working on for quite some time. I've just recently had the cycles to investigate the warning. The warning message...
7
by: Wiebe Tijsma | last post by:
Hi, I'm running a web application application using the Microsoft.Interop.Security.AzRoles version 1.2.0.0 in the GAC. After an upgrade to Vista, I also have a version 2.0.0.0 in the GAC. I...
2
by: JimLad | last post by:
Hi, First of all I didn't design this website, but I have been asked to fix it with the minimum fuss! Website is using .NET on IIS6 with an Excel Interop to produce reports. The website...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.