In my machine I've been enabled the IIS with ASP.NET, see pic below:
When I go to http://localhost the default website open normally.
After that, I created a default WCF project in Visual Studio 2017 in .NET 4.5.
This WCF have an interface ISercvice1.cs
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(int value);
[OperationContract]
CompositeType GetDataUsingDataContract(CompositeType composite);
}
[DataContract]
public class CompositeType
{
bool boolValue = true;
string stringValue = "Hello ";
[DataMember]
public bool BoolValue
{
get { return boolValue; }
set { boolValue = value; }
}
[DataMember]
public string StringValue
{
get { return stringValue; }
set { stringValue = value; }
}
}
And a default SVC Service1.svc, see below:
public class Service1 : IService1
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
public CompositeType GetDataUsingDataContract(CompositeType composite)
{
if (composite == null)
{
throw new ArgumentNullException("composite");
}
if (composite.BoolValue)
{
composite.StringValue += "Suffix";
}
return composite;
}
}
At the IIS I created a new site and referenced the folder inside inetpub folder:
But when I try to open the link (http://localhost:8765/Service1.svc) the error appears:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I don't know what I can do to solve this error, can anyone help me?
Thanks