![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I've just recently started playing with Serviced Components in C#. I've defined a type like: [Guid(...)] public interface IFoo { void Method(); } [Guid(...)] public class Foo : ServicedComponent, IFoo { public void Method() { // ... } } When I run regsvcs.exe on the resulting assembly, the type is registered in COM+ as expected, but so are a number of FCL interfaces and classes; - _Object - IDisposable - IManagedObject - IRemoteDispatch - System_EnterpriseServices_IServicedComponentInfo Also, regsvcs seems to synthesize an interface called _Foo from the class definition, rather than emitting just IFoo. |
).
#3
| |||
| |||
|
|
Also, regsvcs seems to synthesize an interface called _Foo from the class definition, rather than emitting just IFoo. That one is easy. Add another attribute to Foo: [ ClassInterface(ClassInterfaceType.None) ] which tells regsvcs to use the interface, and not sintetize a dual interface instead (and the name suggest it tries to be VB6-like in doing so ). |

|
As for the rest of the interfaces, they are needed for a few internal framwork things, I believe... spelunking with anakrino inside System.EnterpriseServices.Dll is quite interesting ![]() |
#4
| |||
| |||
|
|
I don't mind much, it's just disturbing to the eye. It reminds me of including shared interfaces in a typelib of the component implementing them, which can break typelib marshalling. But I assume there's no problem with running multiple applications with these classes in parallel? |
#5
| |||
| |||
|
|
But I assume there's no problem with running multiple applications with these classes in parallel? There shouldn't, but, overall, remember that this is still COM+ at the bottom of the stack, meaning the restriction of having one ServicedComponent in registerd in only one COM+ application at a time (barring the use of COM+ partitions). |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |