7
votes

I want to use WCF service (.svc) in my WPF project., Iam trying to create a service., but in Visual studio we have "WCF service library" and "WCF service application". I tried both.

When we create "WCF Service application" we will get .svc file., that when we host we will get .svc file as a service referece.

But What about the "WCF service Library" project? When i create this i got only .cs files and i tried to added new .svc files, but we doesnt have the option to add .svc files. Please guide me how to use the services created by "WCF service library" project in My WPF application

1
A WCF Service library is a DLL. It has to be hosted (IIS, self-host, windows service, etc). A WCF Service Application is just that - an IIS-hosted WCF service. A WCF Service Library gives you the ability to host the same service a variety of ways without having to rewrite the same code in each instance.Tim
OK.. WCF Service library is a DLL. I will write all my API's in service.cs., this service dll i want to add to my wpf application. IF i use .svc, i can added using "Add service reference" then what about service.cs dll., is it same how we add a normal "dll" filesAnusha.G
Do you want your WPF app to host the service, or make calls to the service?Tim
To make calls to the serviceAnusha.G
See also this question: stackoverflow.com/questions/1204365/…Ruskin

1 Answers

1
votes

Services created in WCF service library can be hosted using multiple paradigms. The following link (pretty old) explains various ways of histing a wcf service.

http://msdn.microsoft.com/en-us/library/bb332338.aspx

please note that you need .svc file if you are hosting your wcf service in IIS. you can write your own host and will not require .svc file