WebService的使用问题
创建了一个WebService项目,在VS2005中测试一切都正常,但是为什么发布到IIS后访问http://localhost/WebService/Test.asmx,出现如下错误:
[No relevant source lines]
Test.asmp中的内容是:
<%@ WebService Language= "C# " CodeBehind= "~/App_Code/Test.cs " Class= "User " %>
~/App_Code/Test.cs中的内容是:
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
/// <summary>
/// Summary description for Test
/// </summary>
[WebService(Namespace = "http://tempuri.org/ ")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Test : System.Web.Services.WebService {
public Test () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World ";
}
}
请问这是为什么啊,该怎么解决啊?
------解决方案--------------------Test.asmp 中的 Class= "Test "
试试看