WCF测试客户端:无法添加服务。服务元数据可能无法访问。确保您的服务正在运行,揭露元您的、客户端、正在运行、无法访问

2023-09-03 17:14:00 作者:心病无药医 *

我目前想获得同步框架示例工作:样本

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

该解决方案编译与出任何错误或警告。

The solution compiles with out any error or warning.

但是,当我按下F5 WCF测试客户端启动并引发以下错误。

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

本地的\ Temp \测试客户端   项目\ 10.0 \ 5b6aab8a-6629-4a12-87c2-e9e75ba9c1e4 \ Client.cs(379,13):   错误CS0246:类型或命名空间名称'模式'找不到   (是否缺少using指令或程序集引用?)

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?)

下面是 Client.cs 的code,上述错误引用

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.

推荐答案

找到了解决办法好,时间我破解它花很多后。出于某种原因,如果我跑的控制台应用程序,它只是正常工作的样品。但目前我使用WCFTestClient我得到的错误。如果我删除 [ServiceKnownType(typeof运算(SyncIdFormatGroup))] 从它工作在WCFTestClient合同。希望可以帮助别人。

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.

 
精彩推荐