【问题标题】:Visual Studio 2015 Debugger Corruption - Is it a bug or just me?Visual Studio 2015 调试器损坏 - 是错误还是只是我?
【发布时间】:2015-11-01 07:27:59
【问题描述】:

我疯了吗?我一直都能够信任调试器,对吗?

事实证明,在与 VS2015 的调试会话期间,例如,当我在即时窗口中更改变量的值时,该分配会导致分配一个“垃圾”值。每次都是相同的垃圾值,但完全错误。

我已将其提炼为最简单的控制台应用程序重现,以防你可能会同意我对疯狂的自我评估,我还制作了它出错的屏幕截图视频剪辑。

你们是不是也遇到了这个问题,还是本地机器的问题?

这是一个驱动链接:

PS:我正在运行 Windows 10 Enterprise x64、VS2015 Enterprise,并应用了操作系统和 VS 的所有当前更新。底层硬件是现代硬件,我在 VS2013 下没有任何问题。

internal class Program
{
    private static DateTime? _nullableDateTime;

    private static void Main( string[] args )
    {
        // Use the debugger to step through this repro. 
        // * Not sure if it matters, but I started with F11 right from the         start without any breakpoints.
        // ==============================================================================================

        // 1. Variable starts off with default of null
        //    The following statement will confirm that with an "empty" value in the console window
        Console.WriteLine( _nullableDateTime );

        // 2. The next statement assigns the current date and time
        _nullableDateTime = DateTime.Now;

        // 3. The following statement will confirm the correct value in the console window
        Console.WriteLine( _nullableDateTime );

        // 4. THIS IS WHERE THE TROUBLE STARTS
        //    Now, using the immediate window, change the value of the variable with the 
        //    following statement (after the colon) : _nullableDateTime = DateTime.Now
        //    
        //  
        //

        // 5. After changing the value via the immediate window, let's look at it's value now.
        //    For me (as can be seen in the video), I get the completely wrong value in the console window.
        Console.WriteLine( _nullableDateTime );
    }
}

我将开始为 VS Connect 问题整理相同的内容。

编辑:我开始怀疑这是否只是我的问题,因为没有人证实这也发生在他们身上。

编辑:连接问题已提交here

【问题讨论】:

  • 源代码似乎很小。最好将代码添加到您的问题中。
  • 我会买那个,类似于this one。我们无法为您修复该错误,您必须与 Microsoft 联系。使用 Connect 而不是 SO。
  • 谢谢大家 - 会做(添加代码和文件问题与连接)
  • 也为您的连接问题添加了评论。
  • 我遇到了完全相同的问题。 Visual Studio 2015 中的错误。我现在不能信任 Visual Studio。这太可悲了。

标签: visual-studio-2015 visual-studio-debugging corruption


【解决方案1】:

这里有类似的问题。只需学习一个类并以 .NET 3.5 为目标

public class DoSomething
{
    public void Makeit()
    {
    //  Set Breakpoint here
        SortedList<string, string> sortedList = new SortedList<string, string>();
        sortedList.Add("test", "1");
        sortedList.Add("test2", "2"); 
        //when breakpoint hits, uncomment the next line and press F5
        //sortedList.Add("test4", "5");
//Exception


class Program
{
    static void Main(string[] args)
    {
        TestLibrary.DoSomething bla = new TestLibrary.DoSomething();

        bla.Makeit();
    }
}

[]

【讨论】:

    【解决方案2】:

    我可以确认在我安装 Visual Studio 2015 时发生了类似的事情 我还在 Visual Studio 2013 中运行了相同的代码(幸运的是,我在升级时没有卸载它)并且它没有在那里发生:

    是的,您似乎刚刚发现了 Visual Studio 2015 中的一个错误(我的机器运行的是 Windows 7 Pro,所以这不是 Windows 10 的问题)。不幸的是,我缺乏专业知识来评论你的心理健康,所以不要在这方面做任何假设:-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-14
      • 1970-01-01
      • 2016-02-06
      • 1970-01-01
      相关资源
      最近更新 更多