I have a WCF service I’m using from Silverlight code. I wanted to “extend” the public partial class that was generated, but the compiler doesn’t allow me to.
The slSvcUtil service generated code has essentially this:
I have had this problem before and forgot my past solution of adding that bogus namespace file. I don’t think I posted about this before, but thought I should post it now.
So is this a bug, or should I have done something different to get the partial class to compile properly?
Yeah, I had already bumped into the same assembly requirement. But both of the files I listed above are in the same project. And they are the only files in the project.
When I said a “separate assembly”, I meant that both files were in the same, separate assembly from anything else in the solution.
And I added the “bogus” namespace file to get it to compile, so there are now 3 files in the project. The two for the partial classes and the one to help resolve the namespace from the service generated file.
I think the problem stems from the fact that the namespace in the generated file is just “namespace;”. No named namespace. So I think the file that wants to reference the classes in there doesn’t know about the namespace “Guardian.Settings.DataContracts” until I add in the extra file (even when that file has nothing defined in it.
This does sound like a bug then, possibly caused by the different namespace syntaxes (per-unit vs on-the-class-decl). can you send us the exact project that shows this?
My version is getting old already and I don’t want to goof up what I have as I’m in the middle of some serious modifications to a major project.
When I get done with that, hopefully I can update my version and I can check then. If you can’t reproduce it, that sounds like the problem has been fixed.