G
Guest
Hi, guys,
When playing with the sample source code for WCF service at
http://msdn2.microsoft.com/en-us/library/ms730935.aspx, I got an error:
The contract type Microsoft.ServiceModel.Samples.CalculatorService is not
attributed with ServiceContractAttribute. In order to define a valid
contract, the specified type (either contract interface or service class)
must be attributed with ServiceContractAttribute.
at the line
NetTcpBinding portsharingBinding = new NetTcpBinding();
hostDefault.AddServiceEndpoint(
typeof(CalculatorService),
portsharingBinding,
"net.tcp://localhost/MyService");
I did not modify anything. What was wrong here?
Thanks a lot
When playing with the sample source code for WCF service at
http://msdn2.microsoft.com/en-us/library/ms730935.aspx, I got an error:
The contract type Microsoft.ServiceModel.Samples.CalculatorService is not
attributed with ServiceContractAttribute. In order to define a valid
contract, the specified type (either contract interface or service class)
must be attributed with ServiceContractAttribute.
at the line
NetTcpBinding portsharingBinding = new NetTcpBinding();
hostDefault.AddServiceEndpoint(
typeof(CalculatorService),
portsharingBinding,
"net.tcp://localhost/MyService");
I did not modify anything. What was wrong here?
Thanks a lot