Creating derived services in the latest ROSDK.Net RTM is simply impossible.
The generated invoker / implementations aren’t working and there’s no way to fix them manually, because they’re overwritten each time you close the ServiceBuilder.
It’s simple to reproduce:
Case1:
1. create a new C# ROSDK Service project
2. open the RODL and add a new Service "BaseService"
3. edit the default Service "ROServerService" and define the "BaseService" as it's ancestor
4. leave the service builder and try to build the project
Result:
many virtual / override mismatches
derived Servies is trying to call the protected constructor of the “BaseService”
Case2:
1. create a new C# ROSDK Service project
2. open the RODL and make the existing "ROServerService" abstract
3. add a new Service "DerivedService" and define the "ROServerService" as it's ancestor
4. leave the service builder and try to build the project
Result:
many virtual / override mismatches
the constructors and activators ob the abstract “ROServerService” are still generated
derived Servies is trying to call the protected constructor of the ABSTRACT “BaseService”
Case3:
1. create a new C# ROSDK Service project
2. open the RODL clean it up
3. delete all generated ROSDK files from the project
4. open the RODL and create a new BaseService and a new DerivedService in a single step (abstract or not doesn't matter)
5. leave the service builder and try to build the project
Thank you for the detailed reproduction steps.
However these issues doesn’t reproduce for the March 2015 release (8.2.89.1153). Seems you’re using an early post-release Beta where we tested a new code generator changes.
So could you double-check a RO SDK version being used (f.e. it is shown in the title of the Service Builder)?
Also most of the issues doesn’t reproduce in the latest Beta published today (except for the activator for abstract services bug - this one is being fixed) - so you could update to this one.
Could you point where exactly you noticed the virtual/override mismatches?
Derived classes always call their ancestor’s constructors in .NET. Given derived service is represented as derived class in the code its constructor will always call its ancestor constructor.
Same for cases 2 and 3, except for the activator class being generated for abstract service - this issue will be fixed today and we can provide you a beta build containing the fix, if needed.
Strange. I’ll try to find a reproduceable case later.
Yesterday I had overridden methods with a vitual modifier in the base service and a virtual modifier (instead override) in the derived service.
made the default service non-public, abstract in ServiceBuilder and renamed it to "MyBaseService"
and
created a 2nd Service (“DerivedService”, public, not abstract) with “MyBaseService” as ancestor.
Project can’t be built because “CreateInstance()” is trying to call the protected constructor of “MyBaseService”.
[RemObjects.SDK.Activator()]
[System.Reflection.ObfuscationAttribute(Exclude = true, ApplyToMembers = false)]
public class MyBaseService_Activator : RemObjects.SDK.Server.IServiceActivator
{
public MyBaseService_Activator()
{
}
public RemObjects.SDK.IROService CreateInstance()
{
return new MyBaseService(); // <<<< compile error here, because the MyBaseService constructors are protected
}
}