1

I want to host a WCF Data Service (formerly known as ADO.NET data Service) in windows form.Is it possible? If yes,then is there any blog, which talks about it? I know WCF can be hosted in Windows Form, but I am not sure about WCF data service, as all the examples I see, is asking to create ASP.NET web project.

-Brajesh

1 Answer 1

2

It is very easy to host a WCF Data Service in a WinForms application (or in my case a unit test).

// add reference to System.Data.Services // identify your endpoint uri Uri endpoint = new Uri("http://localhost:12345/MyDataService"); // create the data service host DataServiceHost host = new DataServiceHost(typeof(MyDataService), new Uri[] { endpoint }); 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot! Your solution worked and saved lot of my time. -Brajesh
@user158598, then why didn't you mark the question as answered?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.