System.InvalidOperationException:Cannot have two operations in the same contract with the same name

InfoPath alternatives for form designing SharePoint

This error comes when I do method overloading in WCF in C#.Net. When i implement two methods having the same name in WCF I get an error “System.InvalidOperationException:Cannot have two operations in the same contract with the same name”.

So to solve this error we have to implement these two method Using NAME paramerter like below.

[ServiceContract]
public interface IService1
{


[OperationContract(Name=”ShowIntegerData”)]
string DisplayData(int value);

[OperationContract(Name=”ShowStringData”)]
string DisplayData(string value);
}

Also, you can check out my previous posts on:

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply