I would assume, you haven't created an object context before calling a
method on ContextUtil. You need to create a context before you access a
context.
If you aren't using components that are registered in COM+ applications but
you still want to use the services of COM+ (like transactions), then use the
COM+ 'Services Without Components' (SWC) feature. It works on Win2k3 and XP
SP2. Do this:
ServiceConfig config = new ServiceConfig(/* whatever settings you want */);
ServiceDomain.Enter(config);
// do stuff in a transaction...
ServiceDomain.Leave();
Look on MSDN for docs on:
Services Without Components (in COM+ SDK documentation)
System.EnterpriseServices.ServiceConfig (in .Net docs)
System.EnterpriseServices.ServiceDomain.(in .Net docs)
HTH
MikeDice [MSFT]
>I am trying to use Microsoft Distributed Processing and I am getting the
>following error.
[quoted text clipped - 34 lines]
>
> End Class
Mateus Velloso - 03 Dec 2004 16:30 GMT
Mike, I am using Services Without Components and I am loving that, but I have 3 questions about it:
1-Does Microsoft supports and recommends the use of this feature?
2-Will this be compatible with Indigo (no future Migration or upgrade problems)?
3-Is there a bug when you set Isolation to ReadUnCommited to the transaction (seems to be ignored...)?
Thanks!
Mateus Padovani
MCP, MCAD, MCSA, MCSD, MCSE, MCDBA, MCT,
Oracle Certified Professional, Sun Certified J2EE