Search code examples
wcfiis

wcf issues on IIS


After deploying WCF server (svc) on my Server, I have got this message when accessing on: https://test.com/myService.svc

404 - File or directory not found.

Following this post: http://geekswithblogs.net/amaniar/archive/2010/08/31/wcf--iis7-404-file-or-directory-not-found.aspx

I activated the WCF server.

Then, I run: https://test.com/myService.svc and it works only the first time. after that, I can not access IIS any more: Internal Error

This is my binding and service:

 <binding name="BindTest">
      <binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" maxSessionSize="2048">
        <readerQuotas maxDepth="32" maxStringContentLength="10242880" maxArrayLength="10242880" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      </binaryMessageEncoding>
      <httpsTransport />
    </binding> 

<service behaviorConfiguration="ServiceBehavior123" name="xyz">
        <endpoint address="" binding="customBinding" bindingConfiguration="BindTest" name="ServiceEndpoint" contract="ISerice" />
        <endpoint address="mex" binding="mexHttpBinding" name="ServiceMexEndpoint" contract="IMetadataExchange" />
      </service>

I can not access on my IIS anymore. If I remove WCF activation, my web works again but the service wcf svc is not found.


Solution

  • It's possible your service is crashing repeatedly, which causes IIS to shut the app pool down.

    if you stop and restart IIS, you will be able to run it again.

    The solution though, is to correct your implementation - your code - to prevent the crash.

    The crash can be due to an invalid cast, a null pointer exception, and so on. Use try...catch to prevent and diagnose such crashes.