【发布时间】:2017-07-20 10:59:24
【问题描述】:
我有已迁移到 Visual Studio 2015 的旧项目。一切正常,只有 asmx 操作未找到。 我不明白这里有什么问题?我的项目在 IIS express 中运行。 我尝试在 IIS 中创建虚拟目录,如果我从 IIS asmx 打开网站可以正常工作。
我还尝试过删除 .asmx 文件,然后将其添加到项目中。没有任何改变。
仅在 IIS express 中它不起作用(当项目直接从 Visual Studio 运行时)。错误信息:
加载资源失败:服务器响应状态为 404 (未找到) http://localhost:53358/wf/wsSearchCAMERC.asmx/GetBAUSERSearch1
设置:
代码:
namespace fCatEve
{
/// <summary>
/// Summary description for wsSearchCAMERC
/// </summary>
[WebService(Namespace = "fCatEve")]
[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 wsSearchCAMERC : System.Web.Services.WebService
{
[WebMethod]
public string[] GetBAUSERSearch1(string prefixText, int count, string contextKey)
{
// code omitted for clarity
}
}
}
【问题讨论】:
标签: asp.net web-services iis asmx