Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
4.00/5 (3 votes)
See more:
I have a web-site under IIS7 on Win7. Created a new WCF Service Application in Visual Studio 2010 under .NET 4.0. It works fine under ASP.NET Development server, but when I deploy my app to IIS and trying to access it via URL "http://localhost/MySite/Service1.svc" I have this error:
System.Runtime.Remoting.RemotingException: Requested Service not found



If I'm just trying to open site folder "http://localhost/MySite/" I have this error:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Runtime.Remoting.Channels.Http.HttpChannelHelper.GetObjectUriFromRequestUri(String uri)
   at System.Runtime.Remoting.Channels.Http.HttpRemotingHandler.CanServiceRequest(HttpContext context)
   at System.Runtime.Remoting.Channels.Http.HttpRemotingHandler.InternalProcessRequest(HttpContext context)


There is a default.aspx also in this folder and i can open it successfully by direct link "http://localhost/MySite/default.aspx" but it is not opened as default document.

No stack trace, no errors in Windows App or System log. I've tried to enable tracing in web.config - nothing.

The web.config is:

XML
<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>


While researching this problem I've found that error occures even before IIS actually starts my service. I changed my .svc file to have "ServiceLost" instead of "ServiceHost" tag, but error remains the same.

I assume that error source is somewhere in .NET assemblies. But where?!
Posted
Updated 24-Sep-12 23:34pm
v4
Comments
Sergey Alexandrovich Kryukov 24-Sep-12 16:50pm    
Check up the service's URI. Can you ping it?
--SA

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900