tags:

views:

10

answers:

2

Can I have multiple .svc files in one virtual directory under IIS in WCF? If so how?

+1  A: 

You need to have two service contracts and in the web.config section you need to have the two services registered:

<system.serviceModel>
    <services>
        <service name="YourNamespace.Service1" 
                 behaviorConfiguration="returnFaults">
            <endpoint 
                address="" 
                binding="basicHttpBinding"           
                contract="Yournamespace.IService1" />
        </service>
        <service name="YourNamespace.Service2" 
                 behaviorConfiguration="returnFaults">
            <endpoint 
                address="" 
                binding="basicHttpBinding"           
                contract="Yournamespace.IService2" />
        </service>
    </services>
</system.serviceModel>

Then you could have two .svc files for each of your services.

Darin Dimitrov
A: 

I have a similar requirement. How do I host these services under single virtual directory on IIS 5.1 on Windows XP?

The IIS root will point to .svc's and there will be a common Bin one level up. But this is not working !?

DotNetGuy