错误截图:
报错的图片地址:http://photo.blog.sina.com.cn/photo/74aa8abdxa16800626420
“/web”应用程序中的服务器错误。
--------------------------------------------
无法序列化接口 System.Collections.Generic.IList`1[[Model.WebInfo, Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.NotSupportedException: 无法序列化接口 System.Collections.Generic.IList`1[[Model.WebInfo, Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[NotSupportedException: 无法序列化接口 System.Collections.Generic.IList`1[[Model.WebInfo, Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]。]
System.Xml.Serialization.TypeDesc.CheckSupported() +1268995
System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo source, Boolean directReference, Boolean throwOnError) +170
System.Xml.Serialization.ModelScope.GetTypeModel(Type type, Boolean directReference) +83
System.Xml.Serialization.XmlReflectionImporter.IncludeType(Type type) +55
System.Xml.Serialization.XmlReflectionImporter.IncludeTypes(ICustomAttributeProvider provider) +88
System.Web.Services.WebMethodReflector.IncludeTypes(LogicalMethodInfo method, XmlReflectionImporter importer) +65
System.Web.Services.WebMethodReflector.IncludeTypes(LogicalMethodInfo[] methods, XmlReflectionImporter importer) +28
System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors) +375
System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url) +109
System.Web.Services.Protocols.DocumentationServerType..ctor(Type type, String uri) +156
System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +284
System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) +50
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +77
[InvalidOperationException: 无法处理请求。]
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +285
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +183
[InvalidOperationException: 处理请求失败。]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +354
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
高手帮帮忙,这个是什么问题
webService方法:
- C# code
[WebMethod] [XmlInclude(typeof(WebInfo))] public IList<WebInfo> GetAllUrl() { IList<WebInfo> listWeb = WebInfoManager.GetAllWebInfos(); return listWeb; }