An ActiveRecord class (XXXXXXXXX) was used but the framework seems not properly initialized. Did you
来源:互联网 发布:js confirm 修改为yes 编辑:程序博客网 时间:2024/05/16 15:43
问题:
An ActiveRecord class (XXXXXXXXX) was used but the framework seems not properly initialized. Did you forget about ActiveRecordStarter.Initialize() ?
解决方案:
在Global.asax.cs中加入以下代码,如:
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
// 在应用程序启动时运行的代码
IConfigurationSource source = ActiveRecordSectionHandler.Instance;
ActiveRecordStarter.Initialize(System.Reflection.Assembly.Load("你自己XX"), source);
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Items.Add("ar.sessionscope", new SessionScope(FlushAction.Never));
}
protected void Application_EndRequest(object sender, EventArgs e)
{
try
{
SessionScope scope = HttpContext.Current.Items["ar.sessionscope"] as SessionScope;
if (scope != null)
{
scope.Dispose();
}
}
catch (Exception ex)
{
HttpContext.Current.Trace.Warn("Error", "EndRequest: " + ex.Message, ex);
}
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
{
protected void Application_Start(object sender, EventArgs e)
{
// 在应用程序启动时运行的代码
IConfigurationSource source = ActiveRecordSectionHandler.Instance;
ActiveRecordStarter.Initialize(System.Reflection.Assembly.Load("你自己XX"), source);
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Items.Add("ar.sessionscope", new SessionScope(FlushAction.Never));
}
protected void Application_EndRequest(object sender, EventArgs e)
{
try
{
SessionScope scope = HttpContext.Current.Items["ar.sessionscope"] as SessionScope;
if (scope != null)
{
scope.Dispose();
}
}
catch (Exception ex)
{
HttpContext.Current.Trace.Warn("Error", "EndRequest: " + ex.Message, ex);
}
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
1 0
- An ActiveRecord class (XXXXXXXXX) was used but the framework seems not properly initialized. Did you
- The LogManager was not properly installed (you must set the "java.util.logging.manager" system prop
- emulator: ERROR: You did not provide the name of an Android Virtual Device
- The WebLogic Server did not start up properly.
- angular编译出错解决办法Angular Compiler was detected but it was an instance of the wrong class.
- File encrypted properly but not signed properly!
- but he did not hold to the decider
- the value of esp was not properly saved
- the value of esp was not properly saved
- the value of esp was not properly saved
- android The project target (Android 2.2) was not properly loaded
- The project target (Android L (Preview)) was not properly loaded.
- The project target (Android L (Preview)) was not properly loaded.
- The project target (Android L (Preview)) was not properly loaded.
- DLL调用异常:The value of ESP was not properly......
- The project target (Android N (Preview)) was not properly loaded.
- The project target (Android 5.0.1) was not properly loaded.
- play! framework 问题 The JPA context is not initialized
- 单例的几种形式
- iovec结构体定义及使用
- 关于QT自带的打包工具windeployqt的使用
- 上位机和下位机简介
- 对列表List进行赋值
- An ActiveRecord class (XXXXXXXXX) was used but the framework seems not properly initialized. Did you
- 省市区三级联动area
- 基于JWT实现Token的加密和解密
- Struts Action 与ActionSupport的区别
- Java-赋值与初始化
- 面试总结(6):ScheduledExecutorService的使用
- 欢迎使用CSDN-markdown编辑器
- mac 公共密钥
- 正向代理和反向代理