最近玩了一下.NET2005(一直用2003),用它建了一个WEBSERVICE代码如下:
using System;
using System.Web;
using System.Web.Services;
using System.Xml;
using System.Web.Services.Protocols;
using Microsoft.Web.Script.Services;
namespace Samples.AspNet
{    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService]
    public class HelloWorldService : System.Web.Services.WebService
    {        [WebMethod]
        public string HelloWorld(string query)
        {
            string inputString = Server.HtmlEncode(query);
            if (!String.IsNullOrEmpty(inputString))
            {
                return String.Format("Hello, you queried for {0}. The "
                  + "current time is {1}", inputString, DateTime.Now);
            }
            else
            {
                return "The query string was null or empty";
            }
        }
    }
}
------------------------
为什么老报错误 命名空间“Microsoft”中不存在类型或命名空间名称“Web”(是缺少程序集引用吗?)请问我错在哪里?各位大哥帮帮忙