I’m dealing with a problem with WCF Testing. I have a CategorieService WCF service.. See the image https://i.stack.imgur.com/1Wbg1.jpg sharing it through netTcpBinding Everything it’s ok(all methods are being called properly) except the GetAll() GetById() methods. It throws an exception… See the details https://i.stack.imgur.com/I60vt.jpg
Here is the App.config file
<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>
I was using POCO entities with a DbContext connection. The ProxyCreation option must be set to
this.Configuration.ProxyCreationEnabled = false;