Deploy two versions of the same wcf service - wcf

I have created WCF service and its deployed on IIS& under WAS with specific port.binding is the NetTcpBindig.
After we implement another feature to the service and deploy again with separate URL.
but our client wants us to have same URL with two different ports for two different versions of the service.
What is the best option to achieve this task.?

You can host both versions with different ports in IIS. You will have to create two different sites, but I assume you're familiar with that.

Related

Good practice for setting up multiple WCF services in virtual directories under one root url

I am setting up our server to handle all our WCF web services. What I want to know is, what is the best practice for proper isolation of each service under one root domain?
I'm using something like http://api.ourdomain.com and I want each of our client's WCF services to be isolated in separate virtual directories like http://api.ourdomain.com/client1.
I'd like it so that if any one fails/bombs they won't affect other live WCF services running.
Normally I isolate them by website, but since these are all under one 'roof' so to speak, Ihave to do some IIS trickery to properly isolate them.
I had setup a virtual directory and had it as it's own 'app' but I was getting the following error:
"It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process."
Which is strange since I had them both set to use .NET 4.0 framework, so, I'm not sure what happened.

Development WCF server configuration

I am trying to come up with a way to accomplish something but haven't been able to find what I am looking for yet.
4 Developers
1 Development webserver
1 Development WCF server
We each have our own website for testing/debugging on the one server using IIS6. We each have our own port number that distinguishes what site we are connecting to.
When our websites make a request for the WCF server the hosts file on our dev webserver points it at our dev WCF server. Likewise, the production webserver's hosts file points it at our production WCF server. This way we never have to worry about changing the Address of our service references in Visual Studio.
Recently we have a need for multiple developers to be working on multiple branches of the WCF code at the same time. Currently we have to take turns using the WCF server.
We want the ability to have our individual websites on the dev webserver point at individual WCF websites on our dev WCF server.
I have tried several ways I thought of but they all require us to update the Address in the service reference in Visual Studio. (currently if we update/add a service call we point our local machine's host file at the dev site after the new WCF code has been deployed to it.)
Does anyone have any idea, or a direction of where I can find common configurations for this type of thing? I have to assume that Microsoft has a best practices setup for multiple developers with multiple dev environments for websites and WCF sites.
Requirements of the setup:
We only get a single webserver for website testing.
We only get a single webserver for WCF testing.
We need a solution that doesn't require us to update the Address in the service reference in Visual Studio when developing on the WCF code.
If worse comes to worse we may have to think about changing the requirements.
Thank you in advance!
You can simply change the address of the service in configuration file for each deployment. You don't need to change the address of service reference until the service has changed in the way that would produce different client proxy code.

Regarding wcf service hosting

i am new in wcf and started learning. i got one confusion like that i create a small wcf service and just do not host it in IIS,console apps or win service but from another apps i can add the service reference of svc file and found it is working. if wcf can work without hosting in any place like "IIS,console apps or win service " then why people would alway host wcf service in IIS,console apps or win service. can anyone tell me the reason.
people use IIS and windows services in general because they are simpler to setup and run more consistently. they can also be hosted more easily on servers where the services can be configured to start automatically, and as usually wcf is used as a server communication method it is usually this that you want to do.
hosting in console applications is generally easier to setup for simple examples for testing purposes, when you want to test your services locally.
Whilst hosting in applications as possible it's a less common scenario to use wcf to communicate between 2 applications on the same machine.
EDIT:
Your original question asked why people always talk about IIS, services etc. The point I was making was that usually wcf is used for web services, and is usually run on a server other than the local machine. Even though it can be used for inter process communication on the same machine this is not the most common use case. This is why you see a lot of examples using IIS and not too many hosting it in a Windows forms app.

Multiple Services Hosted under one Windows Service

I have two Services called TemplateService, TemplateReportService (both defined in one WCF Service Library) to be exposed to the client application.
Is it possible to host these two services under one Windows Service?
Thank you!
Yes, it is possible. Create two ServiceHost with different endpoints and open both of them when starting the windows service. You can even use the same port (if using net.tcp bindings) by enabling port sharing.
I personally hosted more than 80 services in one process by scanning a specific directory for assemblies with services inside (reflection). This was running on a quite powerful machine (8 cores, 16GB) with thousands of users. Shortly after finishing this I found this link: http://blogs.microsoft.co.il/blogs/alon/archive/2008/03/12/hosting-plug-in-wcf-services.aspx which is basicly doing the same but with a better separation between service hosts by using application domains. On a second try I would use this host.

Running Multiple Services Over net.pipe in WCF

I am building a distributed application that will require 6 different services. I will have to demo the application on my XP laptop using Visual Studio 2008.
Is it possible to run multiple services on localhost at the same time, all using net.pipe?
For example:
net.pipe://localhost/DirectoryService
net.pipe://localhost/MathService
If not, is there any other way to host these WCF services without using IIS/webdev server? net.tcp? Something else?
Another thing you should know about net.pipe addresses is that you are providing a URN, not a URL. net.pipe is an in-memory implementation and the "address" you are specifying can be anything.
net.pipe://IHateCats
net.pipe://NamedPipes/Are/Fast
These will all work, regardless of any other factor. It's just the unique identifier for that named pipe. The network stack is not involved with this form of communication.
Yes, providing the binding addresses are unique. The two examples you've shown will work fine with the net.pipe binding.
Keep in mind the net.pipe binding will only work on the local machine. If you want your services to be accessible from remote machines, you'll need to use a different binding, such as net.tcp. That said, net.pipe is the recommended binding to use if your services run on the localhost because it is more efficient that the other bindings.
You can use HTTP as a service end point without IIS, take a look at the ServiceHost class. That's what I use for local WCF tesing and it works very well.