If you rename the class, be sure to change the class name in the Class property of the WebService directive as well. How to solve it? See picture below.
如果您换了Class名字,你也要把Service1.asmx的名字一起换掉,如何解决呢? 看以下图
use Notepad open Service1.asmx Rename Class Name and Save / 使用 notepad 打开 Service1.asmx 把class的名字换了,存档即可。