0

我正在处理 WCF 测试的问题。我有一个CategorieService WCF 服务.. 查看图片http://i.stack.imgur.com/1Wbg1.jpg通过netTcpBinding 共享它一切正常(所有方法都被正确调用)除了 GetAll() GetById() 方法. 它引发异常...查看详细信息http://i.stack.imgur.com/I60vt.jpg

这是App.config文件

<system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtTransportLevel="true" />
      <endToEndTracing activityTracing="true" />
    </diagnostics>
    <services>
      <service name="Services.CategorieService">
        <clear />
        <endpoint binding="mexHttpBinding" contract="IMetadataExchange"
          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectDistinguishedName" />
          </identity>
        </endpoint>
        <endpoint address="net.tcp://localhost:8888/myservice" binding="netTcpBinding"
          bindingConfiguration="" contract="Services.ICategorieService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
4

1 回答 1

0

我正在使用带有 DbContext 连接的 POCO 实体。ProxyCreation 选项必须设置为this.Configuration.ProxyCreationEnabled = false;

于 2012-06-04T09:47:30.353 回答