仅在调试期间获得 System.AccessViolationException

Getting a System.AccessViolationException only during debug

更新

我已根据最新发现更改了问题并尽可能简化了问题。

我有如下一段代码

public virtual int DefineAction(bool b, string s, Type1 t1, Type2 t2)
{
    return 1;
}

public ProcessResult Process(bool b, string s, Type1 t1, Type2 t2)
{
   int i = DefineAction(b, s, t1, t2);    
   // more code
}

当我在 Line var 上放置一个断点时 int i= ... 然后我尝试逐步完成它,我得到一个 AccessVialoationExeption

更新: 如果我为函数 DefineAction 删除 virtual,则不会抛出异常。

UPDATE2: 如果我从 DefineAction 中删除一个参数,例如将其定义为 DefineAction(bool b, string s, Type1 t1),则不会抛出异常。 现在把我吓坏了:-(

None 的程序集被标记为不安全。单独的线程中没有任何内容 运行ning。

如果我运行程序在Visual Studio调试模式下没有断点,Exeption不会抛出

这里出了什么问题有什么提示或想法吗?

看起来像这个 VS 错误: Weird Access Violation Exception

此处报告: https://connect.microsoft.com/VisualStudio/feedback/details/911564/access-violation-exception-in-vs-hosting-process-when-debugging-application

并且假定在此 .NET 版本中已修复: http://www.microsoft.com/en-us/download/details.aspx?id=42642