如何解决“从非同步的代码块调用对象同步方法”。 [英] how to solve "Object synchronization method was called from an unsynchronized block of code."

查看:275
本文介绍了如何解决“从非同步的代码块调用对象同步方法”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HEllo团队,



调试时,我收到如下错误。



HEllo Team,

While debugging ,I am getting the error as follows .

"Object synchronization method was called from an unsynchronized block of code."





我的代码如下:

我在Global.asax中收到错误:





I have the code as follows :
I am getting the error in Global.asax:

public class Global : System.Web.HttpApplication
    {
        /// <summary>
        /// The Application_Start event fires when application starts first time.
        /// </summary>
        /// <param name="sender">The sender object page.</param>
        /// <param name="e">An event arguments</param>
        protected void Application_Start(object sender, EventArgs e)
        {
            Logger.Write("Preparing cache in Application_Start event started", LogType.Information);
            Kaizen2GController kaizen2GController = new Kaizen2GController();
            Logger.Write("Preparing cache in for combined masters started", LogType.Information);
            kaizen2GController.GetDsitinctCombinedMasterRecords(null);
            Logger.Write("Preparing cache in for combined masters ends", LogType.Information);
            Logger.Write("Preparing cache in for filtered circles start", LogType.Information);
            kaizen2GController.GetFilteredCircles(null);
            Logger.Write("Preparing cache in for filtered circles ends", LogType.Information);
            Logger.Write("Preparing cache in for Regions start", LogType.Information);
            kaizen2GController.GetRegions();
            Logger.Write("Preparing cache in for region ends", LogType.Information);
            Logger.Write("Preparing cache in for CFR Master start", LogType.Information);
            kaizen2GController.GetCfrMasters();
            Logger.Write("Preparing cache in for CFR Master ends", LogType.Information);
            Logger.Write("Preparing cache in Application_Start event Ended", LogType.Information);
        }
}





我正在线上收到错误



Exactly i am getting the error on line

Kaizen2GController kaizen2GController = new Kaizen2GController();





我不知道。如果可以,请指导我。

我和如何找到不同步的代码块。



谢谢

Harshal



I am not getting any idea .Please guide me if you can.
Wher and how i can find the unsynchronized block of code."

Thanks
Harshal

推荐答案

这篇关于如何解决“从非同步的代码块调用对象同步方法”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆