Wasted another couple of hours today trying to figure out why WCF is throwing an EndPointNotFoundException (with a 404 error in the inner exception) on the client when trying to connect to a .svc WCF service, hosted in the ASP.NET development server (VS 2008). Turns out that on the WCF Service Application side, the address should be left empty (or at least not something like http://localhost/Service), otherwise the client will get a mysterious EndPointNotFoundException. The reason for this seems to be that for IIS hosted (and probably ASP.NET development server) the address should be a relative address! See http://msdn.microsoft.com/en-us/library/aa751792.aspx for an explanation. Quoting the text here from paragraph "Endpoint Addresses for IIS-Hosted Services":

When hosted in IIS, endpoint addresses are always considered to be relative to the address of the .svc file that represents the service. For example, if the base address of a WCF service is http://localhost/Application1/MyService.svc with the following endpoint configuration.

<endpoint address="anotherEndpoint" .../>

This provides an endpoint that can be reached at "http://localhost/Application1/MyService.svc/anotherEndpoint".

Similarly, the endpoint configuration element that uses an empty string as the relative address provides an endpoint reachable at http://localhost/Application1/MyService.svc, which is the base address.

<endpoint address="" ... />

You must always use relative endpoint addresses for IIS-hosted service endpoints. Supplying a fully-qualified endpoint address (for example, http://localhost/MyService.svc) can lead to errors in the deployment of the service if the endpoint address does not point to the IIS-application that hosts the service exposing the endpoint. Using relative endpoint addresses for hosted services avoids these potential conflicts.