【发布时间】:2016-02-15 21:22:42
【问题描述】:
我有一个简单的 servicestack 自托管应用程序,除此之外,它还尝试使用身份验证。在 AppHost 构造函数中我拨打电话
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[]
{
new RoomsAuthProvider(),
}));
但我在那个调用期间总是得到空引用异常。我试过分离调用-在一个字符串中创建身份验证功能,添加另一个-AuthFeature 创建失败。我也试过打电话
Container.Register(new MemoryCacheClient());
这没有任何改变。欢迎任何想法。附上 Stacktrace
ServiceStack.AuthFeature.<.ctor>b__a(String s)
ServiceStack.AuthFeature..ctor(Func`1 sessionFactory, IAuthProvider[] authProviders, String htmlRedirect)
CoreServer.Program.AppHost..ctor() в C:\Users\Sorrow\documents\visual studio 2015\Projects\RoomsServicestack\CoreServer\Program.cs
CoreServer.Program.Main(String[] args) в C:\Users\Sorrow\documents\visual studio 2015\Projects\RoomsServicestack\CoreServer\Program
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Threading.ThreadHelper.ThreadStart()
【问题讨论】:
标签: c# .net servicestack httpserver