在Visual Studio 2013 Update 2中单步执行C#-Code时出现AccessViolationException

时间:2014-06-30 19:46:50

标签: c# .net visual-studio-2013 access-violation

我认为我在Visual Studio 2013 Update 2中的调试器中发现了一个错误。当我从抽象类派生并覆盖一个接受带有两个字符串的结构的抽象方法时,调试会话因AccessViolationException而崩溃

此行为在64位体系结构和.NET framework 4.0及更高版本(4.5和4.5.1)上出现。

重现的步骤:

  1. 创建一个新的控制台项目。使用任何CPU或x64(这只适用于支持64位的系统!)并使用.NET Framework 4.0,4.5或4.5.1。
  2. 复制&粘贴下面的代码。
  3. 在Main-method中的第一行代码上设置断点。
  4. 逐步完成代码。
  5. AccessViolationException在Main方法的最后一行出现。
  6. 现在我的问题:

    1. 有人可以重现这种行为吗?
    2. 这怎么可能发生?如何比使用visual studio更好地调试这些错误?
    3. 我在哪里可以举报此类错误?
    4. 感谢您的时间。

      代码:

      using System;
      using System.Collections.Generic;
      using System.Text;
      
      namespace test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  Structure structure = new Structure();
      
                  Caller caller = new Caller();
      
                  caller.Execute(structure);
              }
          }
      
          public abstract class Father
          {
              internal Father()
              {
              }
      
              public abstract bool Execute(Structure structure);
          }
      
          public class Caller : Father
          {
              public Caller() : base()
              {
              }
      
              public override bool Execute(Structure structure)
              {
                  return true;
              }
          }
      
          public struct Structure
          {
              public string A;
              public string B;
          }
      }
      

0 个答案:

没有答案