4

I am currently trying to get the sync framework sample working: sample

The solution compiles with out any error or warning.

But when I hit F5 the WCF Test Client launches and throws the following error.

Local\Temp\Test Client Projects\10.0\5b6aab8a-6629-4a12-87c2-e9e75ba9c1e4\Client.cs(379,13) : error CS0246: The type or namespace name 'schema' could not be found (are you missing a using directive or an assembly reference?)

Below is the code from Client.cs that the above error is referencing

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization")]
public partial class SyncIdFormatGroup
{
    private schema schemaField;
    private System.Xml.XmlElement anyField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.w3.org/2001/XMLSchema", Order=0)]
    public schema schema
    {
        get { return this.schemaField; }
        set { this.schemaField = value; }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlAnyElementAttribute(Order=1)]
    public System.Xml.XmlElement Any
    {
        get { return this.anyField; }
        set { this.anyField = value; }
    }
}

It would be great if some one could help me with the problem.

3
  • Have you created a class called schema? I think it is complaining that schema is a keyword maybe? Oct 25, 2011 at 12:24
  • Can you show the code of schema class , is it tagedd with [DataContract] attribute and its member with [DataMember] attribute?
    – DeveloperX
    Oct 25, 2011 at 12:45
  • @stuartmclark I do not have any class called schema. The class I am referring to is created by WCTTestClient Oct 25, 2011 at 23:43

3 Answers 3

3

Found the solution Ok, after spending lot of time I cracked it. For some reason if I run the sample as console app it just works fine. But the moment I use WCFTestClient I was getting errors. If I remove the [ServiceKnownType(typeof(SyncIdFormatGroup))] from the contract it works in WCFTestClient. Hope that helps someone.

2
  • 1
    Congrats on the solution. When you are able, please make sure to mark your answer as 'accepted' so that others might learn from your success. Cheers~ Dec 21, 2011 at 19:13
  • Sorry guys, completely lost track. Have Marked the answer Oct 30, 2012 at 23:35
2

Have you enabled a mex (metadata exchange) endpoint in your service?

<endpoint 
      address="mex" 
      binding="mexHttpBinding" 
      contract="IMetadataExchange"/>
0
0

Read the note at the end of the page: Note: If you use Visual Studio 2010 to compile these samples, you will first need to remove references to the Sync Framework assemblies and then re-add the assembly references to the projects. Otherwise, you will see "type or namespace name could not be found" compilation errors. http://code.msdn.microsoft.com/Database-Sync-SQL-Server-7e88adab#content or http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208

1
  • Welcome to StackOverflow - good first answer. One way of improving your answer would be to clarify which "page" you;re referring to ... Apr 3, 2013 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.