问题描述
usingSystem;usingSystem.Collections.Generic;usingSystem.Configuration;usingSystem.IO;usingSystem.Text;usingSystem.Linq;usingSystem.Net;usingSystem.Threading;usingSystem.Web;usingSystem.Web.Services;usingSystem.Xml;usingSystem.ComponentModel;usingSystem.ServiceModel;usingSystem.Web.Script.Services;namespaceWebService{[WebService(Description="人口信息服务",Namespace="http://www.egmap.cn/Services")][WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)][System.ComponentModel.ToolboxItem(false)][ServiceBehavior(IncludeExceptionDetailInFaults=true)]publicclassGISService:System.Web.Services.WebService{[WebMethod(Description="根据身份证号查找常住人口BASE64格式照片数据",EnableSession=true)]publicstringmyTest(){WebClientclient=newWebClient();client.DownloadStringCompleted+=testComplete;client.DownloadStringAsync(newUri(sUrl));//此处错/*System.InvalidOperationException”类型的异常在System.Web.dll中发生,但未在用户代码中进行处理其他信息:现在无法开始异步操作。异步操作只能在异步处理程序或模块中开始,或在页生存期中的特定事件过程中开始。如果此异常在执行Page时发生,请确保Page标记为<%@PageAsync="true"%>。*/.....}}}
解决方案
解决方案二:
LZ问题解决了没有,是否是配置文件的问题