Can't compile slSvcutil generated class

This line is generated from a WCF interface file generated by slSvcUtil for Silverlight 5:

GuardianEditObservationServiceClientChannel nested in GuardianEditObservationServiceClient  = class(ChannelBase<IGuardianEditObservationService>, IGuardianEditObservationService)

The compiler gives me this error:

Error 64 (E380) Type “System.ServiceModel.ClientBase.ChannelBase<IGuardianEditObservationService,IGuardianEditObservationService>” cannot be used as ancestor for type “GuardianEditObservationServiceClient.GuardianEditObservationServiceClientChannel”, because it does not have the right visibility C:\Users\Mark\Documents\Visual Studio 2013\Projects\SW\GuardianEditObservation\EOServerServiceInterface\GuardianEditObservationService.pas 716 5 EOServerServiceInterface

This worked fine in my Silverlight 4 project with an OLD version of Oxygene.

What is it trying to tell me and how can I fix it since it isn’t MY code, but generated from the WCF service?

… time passes …

hmm… I’m seeing this in my generated code:

// <autogenerated>
//     This Oxygene source code was generated by a tool.
//     Runtime Version: 4.0.30319.34209
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated>

That makes it sound like slSvcUtil did NOT replace the file from the SL 4 version code. I’ll have to double check that slSvcUtil is really replacing the file.

Still, if anyone can tell me what the error message is trying to tell me, that would be appreciated.

… time passes …

Doh! Hidden in the slSvcUtil is an error. So hopefully when I resolve that, the generated code WILL work.

… time passes …

Bummer. I fixed the slSvcUtil problem, but generated code still won’t compile.

… time passes …

hmm… That autogenerated part still says the same version. Maybe it didn’t changed for SL 5? Or maybe somehow it figured out what to use from the service somehow? Odd.

… time passes …

Looks like slSvcUtil is a 5.x version. I’m guessing that 4.x comment is talking about .net.

So I still don’t know why this code won’t compile. Looks the same as far as I can see as when it was in the VS 2010 which compiled fine with Delphi Prism.

Anybody got any clues?

Also, for the code that won’t compile, this is the interface it is referencing in that same file, in case that helps:

type
    [System.CodeDom.Compiler.GeneratedCodeAttribute('System.ServiceModel', '4.0.0.0')]
    [System.ServiceModel.ServiceContractAttribute(&Namespace := 'http://www.swtechnologies.com/GuardianService', ConfigurationName := 'IGuardianEditObservationService')]
    IGuardianEditObservationService = public interface

I’m still dead in the water on this one. Anybody got a clue so I can compile and use this service from my Silverlight application? Otherwise, I can’t go any further using Oxygene with SL 5 and VS 2013.

my colleague is looking into this but is having some trouble with her machine. she’ll reply.

I made a new project. Just with the Silverlight Web Site application and one Silverlight project. Generated it from the template. Edited the web.config and put the necessary web servicemodel stuff in there. Then did an Add Service Reference. Discover found it and I generated the code.

The generated code does not compile.

Is there a way to send you the simple solution that doesn’t work?

Easiest is support@ (mentioning this url)

Does this work?SilverlightApplication67.zip (1.8 MB)

I finally spotted the little Upload icon

I wonder if the problem is that the ChannelBase is a Public Abstract? Maybe the Abstract is what it doesn’t like?

Found it, use this:

GuardianSettingsServiceClientChannel nested in GuardianSettingsServiceClient  = protected class(ChannelBase<SilverlightApplication67.ServiceReference1.IGuardianSettingsService>, SilverlightApplication67.ServiceReference1.IGuardianSettingsService)

Thanks, logged as bugs://72329

That made it compile successfully. Of course, each regenerated would replace that. I’m sure the compiler will remind me to go change it again :smile:

Why was it okay in the old compiler without the protected and the new compiler can’t handle it? Out of curiosity. Did the ChannelBase somehow change from public to protected, or something?

i think the new codegen causes the compiler to not emit protected while it did in the past, causing this.

I presume the “new codegen” is something in RemObjects and not Silverlight. My Silverlight 4 with Delphi Prism did NOT generate the protected and it compiled and ran just fine.

I VAGUELY recall this maybe being an issue long, long ago when I first started doing Silverlight. If I’m correct, somehow, it got fixed, presumably by you guys.

But in any case, the old generated code looks just like the new generated code (for that line). So nothing changed there, fwiw.

bugs://72329 got closed with status fixed.