【问题标题】:VS2015 asmx method not foundVS2015 asmx方法没找到
【发布时间】: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


    【解决方案1】:

    我通过将方法从 .asmx 复制粘贴到 MVC 控制器解决了这个问题,默认情况下是异步的。我现在可以使用与 .asmx 相同的链接调用这些方法。

    【讨论】:

      猜你喜欢
      • 2016-07-21
      • 2018-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-11
      • 2012-04-12
      • 2021-09-29
      • 1970-01-01
      相关资源
      最近更新 更多