ASP.Net doesn't like my ServicedComponent class? [C#]

J

Jim Bancroft

Hi everyone,

I have a toy class that inherits from ServicedComponent and a
hand-crafted interface. It looks like this:

[Transaction(TransactionOption.Supported)]
public class myclass: ServicedComponent, IReadData //IReadData is the
hand-blown interface
{
public string GetString()
{
return "hello";
}

[AutoComplete]
public string GetData(string strParameters)
{
return "goodbye";
}
}
}

I've put this into a COM+ package, using regsvcs.exe, and made the package
as "open" as possible-- no security access checks, for instance. It's
running as a server application under COM+.

Here's the trouble: calling the class's GetData() method in a console app
works fine, but the same call from an ASP.Net page gives an error that says:
"System.InvalidCastException: QueryInterface for interface
Interfaces.IReadData failed."

Here's my definition of the IReadData interface-- it's simple enough:

public interface IReadData
{
{
string GetData(string strParameters);
}
}


Am I doing something wrong here that I can't see? Are you allowed to
inherit from interfaces at the same time as ServicedComponent, or are there
restrictions regarding this I don't know about? Or, is there something else
entirely at work? I'm scratching my head as to why this is happening.

Thanks for any and all help.

-Jim
 
J

Jo Siffert

Hi Jim,

sounds like the assembly versions ASP and the COM+ server uses differ -
try to undeploy from ES, remove from the GAC (all versions), rebuild,
reregister in GAC and redeploy your assembly. And make that no copy of
the assembly resides somewhere in the ASP.NET directory.

/Jo
 
J

Jim Bancroft

Thanks for the advice; I've recompiled everything, pulled components out of
the GAC, put them back in, pulled them out again, run regsvcs.exe more times
than I care to count-- and I'm just where I started.

Interestingly, my code does work if I quit inheriting from ServicedComponent
and yank out any COM+ method attributes. In that case my ASP.Net page has
no problem querying for, and using, my GetData() method. But as soon as I
inherit from ServicedComponent again and put the component back under a COM+
application, ASP immediately acts like it's never heard of my interface--
strange indeed. I'll keep plugging away....
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top