0

我的项目中有一个网络服务。每当我尝试添加服务参考时,它都会显示特定错误

Could not create type 'json_read.GetMapLocation'.

源错误

Line 1:  <%@ WebService Language="C#" CodeBehind="GetMapLocation.asmx.cs" Class="json_read.GetMapLocation" %>

这是我的网络服务

<%@ WebService Language="C#" CodeBehind="GetMapLocation.asmx.cs" Class="json_read.GetMapLocation" %>

后面的代码

namespace json_read
{
    /// <summary>
    /// Summary description for GetMapLocation
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    //[System.Web.Script.Services.ScriptService]
    public class GetMapLocation : System.Web.Services.WebService
    {

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

我在这个错误中苦苦挣扎了几天,但还没有灵魂。感谢您的帮助。

4

0 回答 0