2012-08-01 42 views
0

当我在锁(...)或唯一的IF语句在代码中进行断点调试monodroid中的多线程应用程序时,它不工作。但是,当我在关键字前做出断点,然后逐步调试时,它就可以工作。为什么?该如何解决?断点不工作在Monodroid多线程应用程序

代码(传感器监听器类):

static object lockAll = new object(); 
     public void OnSensorChanged(SensorEvent ev) 
     { 
      int g1 = 8; //Breakpoint in this place works 
      lock (lockAll) 
      { 
      int g2 = 8; //Breakpoint in this place isn't works 
      } 
     } 

或者:

public void OnSensorChanged(SensorEvent ev) 
    { 
     Sensor curS = ev.Sensor; //Breakpoint in this place works 
     if (curS.Type == SensorType.Accelerometer) 
      { 
      int g2 = 8; //Breakpoint in this place isn't works 
      } 
    } 
+1

我接受:) – Brans 2012-08-01 15:53:36

+1

有些代码呢? – 2012-08-01 15:54:58

+0

现在你可以看到代码示例 – Brans 2012-08-02 07:48:16

回答

0

我遇到同样的问题,与通过VS2010 IDE MonoDroid的。很多时候,我必须强制关闭平板电脑(或其他设备)上的应用程序,关闭IDE,重新打开IDE,重新部署应用程序..然后有时候断点将开始工作再次预期。

+0

这是其他问题。当Visual Studio无法删除调试文件时。我修复了下载的名为“unloker”的软件(http://www.filehippo.com/download_unlocker/)并使用这样的bat文件:@echo off D:\ MyProject \ bin \ UnlockerPortable \ App \ Unlocker \ Unlocker.exe D :\ MyProject \ bin \ Debug \ Point.dll.mdb/S del Debug \ MyProject.dll.mdb/F/Q :错误 回应失败,错误#%errorlevel%。 exit/b 0然后你可以添加这个蝙蝠在构建之前在VS中执行autamaticaly。这将解决这个bug。但那是其他错误 – Brans 2012-08-02 07:41:27