【发布时间】:2012-02-11 21:00:52
【问题描述】:
我有以下代码(从 here 提取),我正尝试在带有 mono 2.10.5 的 linux 服务器上运行它。
private static HttpContext GetCurrentContext(ControllerContext context) {
var currentApplication = (HttpApplication)context.HttpContext.GetService(typeof(HttpApplication));
if (currentApplication == null) {
throw new NullReferenceException("currentApplication");
}
return currentApplication.Context;
}
在单声道上运行时,我得到以下异常,这很简单:
System.NotImplementedException: The requested feature is not
implemented. at System.Web.HttpContextWrapper.GetService
(System.Type serviceType) [0x00000] in <filename unknown>:0
我可以使用一种已知的解决方法在单声道上实现相同的结果吗?
【问题讨论】:
标签: asp.net asp.net-mvc mono