【发布时间】:2014-11-29 19:34:31
【问题描述】:
我需要运行我的应用程序,该应用程序在 IIS 和 .NET CLR 自托管模式下都提供了一些 ASP.NET Web API 服务。 我基于 OWIN 开发了我的 ASP.NET Web API 服务,它在两台主机上都运行良好。 现在我需要这样的东西:
public class OwinContextInfrastructure
{
public static IOwinContext Current
{
get
{
if (HttpContext.Current != null)
{
return HttpContext.Current.GetOwinContext();
}
else
{
// What should I do here ?
return null;
}
}
}
}
在我的应用程序中需要时获取当前的 owin 上下文。
我的代码在 IIS 上运行良好,但在 .NET Self Host 模式下我应该怎么做?
【问题讨论】:
标签: asp.net .net iis owin self-hosting