“System.Web.HttpContext cannot be serialized because it does not have a parameterless constructor.”

空扰寡人 提交于 2019-11-29 07:16:51

You're not going to be able to serialize the HttpContext. Your best bet would be to create a custom class to encapsulate the information that you want out of the HttpContext and pass that into your WebMethod.

You will need to create a class that is serialisable designed to hold the sort of information that you wish to gather. Then create Static method on that class which will create an new instance of the class and gather up the info required.

Its would be this new class that would be passed to LogError.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!