I have a super-simple WCF Service. I host it on my local machine using IIS7.
When I add a service reference to my service, Visual Studio tells me there was an error. I can click a Details link, and that bring up a dialog box saying: Object reference not set to an instance of an object.
I can build my WCF service with no problems, and my client app also builds successfully.
I can even use svcutil http://localhost/logservice/logservice.svc?wsdl to generate a client.
I've seen this error in my Windows Event Log/Viewer:
.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (706B7706) (80131506)
I found a hotfix online, but that won't install...
I think this has something to do with the client solution from where I add the service reference. I can add a service refenrece using the the "Discover services in solution" function. I just need to add a service reference in a solution elsewhere, so this is driving me nuts.
My system.serviceModel of web.config looks as follows:
<system.serviceModel>
<services>
<service behaviorConfiguration="LogServiceBehavior" name="LogService">
<endpoint address="" binding="wsHttpBinding" contract="ILogService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="LogServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>