在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (Exception from HRESULT: 0x80070459)
环境:VS2008 Team System英文版,Framework3.5 SP1,Vista中文高级家庭版,开发MVC程序的时候访问HttpContext.Current.Request.UrlReferrer的时候报错,具体如下:
在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (Exception from HRESULT: 0x80070459)
堆栈信息:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Web.Hosting.IIS7WorkerRequest.GetServerVariableInternal(String name)
at System.Web.Hosting.IIS7WorkerRequest.GetServerVariable(String name)
at System.Web.Hosting.IIS7WorkerRequest.ReadRequestHeaders()
at System.Web.Hosting.IIS7WorkerRequest.GetKnownRequestHeader(Int32 index)
at System.Web.HttpRequest.get_UrlReferrer()
at Newapple.ControlPanel.WebRuntime.DataModel.ServerLastError.GetLastError() in D:\Project\Newapple\SourceCode\Newapple.ControlPanel\ControlPanel.WebRuntime\DataModel\ServerLastError.cs:line 24
at Newapple.ControlPanel.WebRuntime.Web.HttpModules.GlobalModule.Application_Error(Object sender, EventArgs e) in D:\Project\Newapple\SourceCode\Newapple.ControlPanel\ControlPanel.WebRuntime\Web\HttpModules\GlobalModule.cs:line 69
at System.Web.HttpApplication.RaiseOnError()
请问各位高手怎样解决?? --------------------编程问答-------------------- 有人知道怎样解决吗? --------------------编程问答-------------------- 我也碰到过 我的情况是 【Request】这个对象似乎是null从而引发错误
但如果是null的话 应该是【未将对象引用设置到对象实例】才对啊。不解。
总之,在【Application_Error】里处理【Request】还是需要很谨慎的 --------------------编程问答-------------------- 顶出去。
补充:.NET技术 , ASP.NET