Web服务在单声道4中不起作用

我有一个使用Web服务与ASP.Net的应用程序,我应该维护。 所以我在这个主题上提高了我的技能。 我在使用VS 2013的Window中运行Webservice没有问题,但是有单声道问题。

这是我运行代码时遇到的错误

System.ArgumentNullException Value cannot be null. Parameter name: path1 Description: HTTP 500.Error processing request. Details: Non-web exception. Exception origin (name of application or object): mscorlib. Exception stack trace: at System.IO.Path.Combine (System.String path1, System.String path2) [0x00006] in :0 at System.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath () [0x0000c] in :0 at System.Web.Services.Protocols.DocumentationServerProtocol.Initialize () [0x001f1] in :0 at System.Web.Services.Protocols.ServerProtocol.SetContext (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response) [0x00022] in :0 at System.Web.Services.Protocols.ServerProtocolFactory.Create (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response, System.Boolean& abortProcessing) [0x00014] in :0 

这是代码

WebService1.asmx

  

WebService1.asmx.cs

 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Xml; namespace DemoService { ///  /// Summary description for WebService1 ///  [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 WebService1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public XmlElement AddMe(int a, int b) { XmlDocument doc = new XmlDocument(); for(int i=0; i<5; i++) { XmlNode n = doc.CreateNode( XmlNodeType.Element, i.ToString(), "me.com.aisee"); for(int j=0; j<5; j++) { //n.AppendChild(doc.CreateElement(j.ToString())); } } return doc.DocumentElement; } } } 

我不是我想念的。 据我所知,它应该工作正常。 这是我的Mono版本

 ~$ mono --version Mono JIT compiler version 4.3.0 (tarball Fri Jun 12 11:43:58 UTC 2015) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen 

这是单声道的错误。 您可以在这里查看: https : //bugzilla.xamarin.com/show_bug.cgi?id = 37137

和https://bugzilla.xamarin.com/show_bug.cgi?id=39772

看起来webservice的Documentation页面尚未实现。 但是,尽管出现此错误,web服务仍应正常工作。 您可以通过在URL的末尾添加?WSDL来查看它,即http://localhost/WebService1.asmx?WSDL