I have a test WCF project. In the same solution I have a C# application that uses that WCF project by simply adding it as a resource and it works well. But how do I upload it (-WCF) to a website?
I tried Build -> Publish. But it didn’t give me any dialog; it just said “Publish succeeded”. So I converted it to a web application (right click in solution explorer…)
and then published it. Since I wanted to try it – I published it to the file system. But when I now try to add a service reference to it in a C# app – I get the error that “No services were found in the solution”. Why is that?
But the question is mainly: when I try to publish it to a website – I don’t know what to put as “Service URL” and what as “Site/application”.
Here’s what I have:
Iservice1:
[ServiceContract]
public interface IService1
{
[OperationContract]
string DoWork();
}
Service1:
public class Service1 : IService1
{
public string DoWork()
{
return "Hello, world";
}
}
And in the C# app:
Service1Client s = new Service1Client();
Text = s.DoWork();
So finally I simply built a web application and added a WCF service to it.