In ASP.NET Application,I can't add a local webmethod to my project preferences

Kwrister 96 Reputation points
2020-12-29T04:50:04.737+00:00

First, I create a default Web Service(ASMX).And It has a default webMethod.just like:
public class WebService1 : System.Web.Services.WebService
{

    [WebMethod]  
    public string HelloWorld()  
    {  
        return "Hello World";  
    }  
}  

Next,I want to add this method to my objects's references, but it show some errors:
51864-%E6%8D%95%E8%8E%B7.png

and the detail is
51887-%E6%8D%95%E8%8E%B72.png

I don't konw why.
Please help me.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,354 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful