Saturday 19 September 2015

Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods.

Server Error in '/' Application.

Both System.String UpdateAccountActions(System.String) and System.String UpdateAccountActions(System.String, System.String, System.String) use the message name 'UpdateAccountActions'.  Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Both System.String UpdateAccountActions(System.String) and System.String UpdateAccountActions(System.String, System.String, System.String) use the message name 'UpdateAccountActions'.  Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods.


Soloution
 Use following attributes
[WebMethod(Description="method1") ]
[WebMethod(Description = "method2")]
[WebMethod(Description="method3")]
or
[WebMethod(MessageName="method1") ]
[WebMethod(MessageName = "method2")]
[WebMethod(MessageName = "method3")]

More on http://www.c-sharpcorner.com/UploadFile/718fc8/description-and-messagename-property-of-webmethod-in-web-ser/