locked
DssProxy fails to generate proxy when datamembers contain multiple namespaces RRS feed

  • Question

  • I have a DSS service that includes a custom type within it's state as shown below...

    namespace MyService
    {
      [DataContract]
      public class MyServiceState
      {
        [DataMember]
        public MyTestClass TestStateObject;
      }
    }
    

    The custom type is actually a derived type which is built from a base type within another project (i.e. namespace) as shown below...

    namespace TestClassLibrary
    {
      [DataContract]
      public class MyTestClass : MyTestBaseClass
      {
        
      }
    }
    

    and the base class...

    namespace TestClassBaseLibrary
    {
      [DataContract]
      public class MyTestBaseClass
      {
        
      }
    }
    
    This causes the DssProxy to fail to generate the proxy for my service as it states that it is missing a reference required to generate this type. However, if I simply give the base and derived classes the same namespace the DssProxy builds the service proxy correctly. Are there any DssProxy options that I need to set to support derived types from multiple namespaces or is there any other way to work around this problem? Thanks!

    Friday, July 9, 2010 12:20 PM

Answers

  • To summarize my last post :

     - All classes marked with "DataContract" should be in a MSRDS project (i.e compile in MSRDS\bin and dssproxy runs on it)

    - You should edit AssemblyInfo.cs and change the DssServiceDeclaration to DataContract if the assembly doesn't contain a service implementation

    - A "Contract" class should be defined for each namespace that contains "DataContract" classes

    Regards,

    Vincent


    http://www.simplysim.net/
    Friday, July 16, 2010 6:52 AM

All replies

  • Hello,

    In order to serialize the whole hierarchy, dssproxy must find a .proxy for all referenced types. Have you defined a "Contract" in each namespace ? Have you run the dssproxy on all your assemblies that contain "DataContract" definition ?

    Regards,

    Vincent


    http://www.simplysim.net/
    Monday, July 12, 2010 6:27 AM
  • I don't think that I quite understand your response as I am attempting to create the proxy files using the DssProxy tool thus there won't be proxy files till after the tool successfully runs. Also, I have verified that DssProxy works correctly and generates the MyTestClass serialization code correctly (as long as the MyTestBaseClass is in the same namespace) even though MyTestClass is actually contained in a separate Visual Studio project from that of the MyService . Thus, I should not have to run the DssProxy tool on each project that is referenced by MyService .

    Thursday, July 15, 2010 5:50 PM
  • To summarize my last post :

     - All classes marked with "DataContract" should be in a MSRDS project (i.e compile in MSRDS\bin and dssproxy runs on it)

    - You should edit AssemblyInfo.cs and change the DssServiceDeclaration to DataContract if the assembly doesn't contain a service implementation

    - A "Contract" class should be defined for each namespace that contains "DataContract" classes

    Regards,

    Vincent


    http://www.simplysim.net/
    Friday, July 16, 2010 6:52 AM