3
我想構建asp.net mvc4應用程序,並在運行應用程序時,我得到了關於lazyinitializer語句的錯誤Exception has been thrown by the target of invocation
。請幫忙。提前致謝。我的代碼如下由調用lazyinitializer的目標拋出異常mvc4
namespace CMMIS.Web.Filters
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute
{
private static SimpleMembershipInitializer _initializer;
private static object _initializerLock = new object();
private static bool _isInitialized;
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
// Ensure ASP.NET Simple Membership is initialized only once per app start
LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
}
請包括堆棧跟蹤 – 2013-05-02 05:45:39