Note that there are some explanatory texts on larger screens.

plurals
  1. POVS2008 Crashes when adding a WCF service
    text
    copied!<p>I have a Console application hosting a WCF service:</p> <p><em>Updated this code to run off the app.config file instead of initialising it programatically</em></p> <pre><code>Uri baseAddress = new Uri("http://localhost:8000/ChatServer/Service"); ServiceHost myHost = new ServiceHost(typeof(ClientServerChat.ChatServer), baseAddress); myHost.AddServiceEndpoint(typeof(IChat), new WSHttpBinding(), "ChatService"); ServiceMetadataBehavior mb = new ServiceMetadataBehavior(); ServiceBehaviorAttribute attrib = (ServiceBehaviorAttribute)myHost.Description.Behaviors[0]; attrib.IncludeExceptionDetailInFaults = true; mb.HttpGetEnabled = true; myHost.Description.Behaviors.Add(mb); myHost.Open(); </code></pre> <p>The Console app compiles and runs. svcutil runs perfectly.</p> <p><em>Svcutil runs against the new service code perfectly and generates the Client code and the ouput file</em></p> <p><em>I'm calling svcutil via the Visual Studio Command Prompt like so: svcutil.exe <a href="http://localhost:8000/ChatServer/Service" rel="nofollow noreferrer">http://localhost:8000/ChatServer/Service</a></em></p> <p>It generates this output.config:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="WSHttpBinding_IChat" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt; &lt;security mode="Message"&gt; &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://localhost:8000/ChatServer/Service/ChatService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IChat" contract="IChat" name="WSHttpBinding_IChat"&gt; &lt;identity&gt; &lt;userPrincipalName value="Bedroom-PC\Roberto" /&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>Along with the bundled client code (which is in the same directory as the output file, I should add) I should be able to call the service with this:</p> <pre><code>ChatClient client = new ChatClient(); </code></pre> <p><em>The new output from svcutil (both code and config) still throws this exception.</em></p> <p>But it throws an exception saying: </p> <p>"Could not find default endpoint element that references contract 'IChat' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."</p> <p>Interestingly, Visual Studio 2008 will crash when adding the same Service reference to a Client project.</p> <p><em>VS2008 still crashes with the updated code.</em></p> <p>It will find the service, get all the operations and what not. When I click Add, it crashes.</p> <p>Any one have a clue whats going on??</p> <p>Thanks in advance</p> <p>Roberto</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload