标签: visual-studio-debugging

Silverlight项目不会进入调试模式

我在VS 2010中的Silverlight项目已停止进入调试模式.即使我在Application类的构造函数中设置了断点,它也拒绝遇到任何断点.我的其他项目仍然很好,但我找不到任何可能意外更改的设置,以防止我调试.会发生什么事?

silverlight visual-studio-2010 visual-studio-debugging

2
推荐指数
1
解决办法
1520
查看次数

控制.NET BCL类型在调试器中的显示方式(对KeyValuePair(TKey,TValue)感兴趣)

这里有一个关于在KeyValuePair(TKey,TValue)中覆盖ToString()的问题,这是不可能的.

我看到有一些属性类型,如DebuggerDisplayAttribute,DebuggerTypeProxyAttribute可以控制一个类型显示在调试器的方式.我只使用了调试器可视化工具.

从逻辑上讲,这些属性只能应用于用户定义的类(我认为除了部分类).

那么有没有办法在Visual Studio中控制内置(BCL).NET类型的调试结果?

编辑:为了使它更清晰一点,我主要对该类型的字符串表示感兴趣.它只是为了调试而"覆盖"ToString().

.net c# debugging visual-studio visual-studio-debugging

2
推荐指数
1
解决办法
302
查看次数

Visual Studio Debugger观察问题

如何在visual studio调试器监视窗口(或其他地方)中找到堆栈上变量的地址?

读取变量工作正常:

streets     streets [11790](0x1c66a690 [...] std::vector<Street *,std::allocator<Street *> >
Run Code Online (Sandbox Code Playgroud)

但前缀为&并没有给我一个地址:

&streets        streets [11790](0x1c66a690 [...] std::vector<Street *,std::allocator<Street *> >
Run Code Online (Sandbox Code Playgroud)

此外,试图读取大小不起作用,为什么?

streets.size()  CXX0075: Error: Cannot set up Function Evaluation   
Run Code Online (Sandbox Code Playgroud)

程序以调试模式编译.

c++ native visual-studio-debugging

2
推荐指数
1
解决办法
2615
查看次数

为什么只有来自子任务的许多异常中的一个总是传播?

我正在努力更好地掌握TPL中异常和错误处理的基本原理(并且在.NET 4.5 async/await tasks中有更多运气)

稍微修改了我之前的问题"如何更好地理解来自"异步 - 处理多个异常"的文章中的代码/语句?" C#控制台应用程序代码运行2个分离的内部嵌套附加(依赖)子级(更新:抱歉,启动了一个问题,但由另一个问题结束!)任务:

class Program
{  
   static void Main(string[] args)
   {  Tst();
      Console.ReadLine();
   }
   async static Task  Tst()
   {
       try
       {
           await Task.Factory.StartNew
             (() =>
                {
                   Task.Factory.StartNew
                       (   () => { 
                                    Console.WriteLine("From 1st child");
                                    throw new NullReferenceException(); 
                                  }
                            , TaskCreationOptions.AttachedToParent
                        );
               Task.Factory.StartNew
                       (  () =>
                               { 
                                   Console.WriteLine("From 2nd child");
                                   throw new ArgumentException(); 
                               }
      ,TaskCreationOptions.AttachedToParent
                       );
                }
             );
    }
    catch (AggregateException ex)
    {
        Console.WriteLine("** {0} **", ex.GetType().Name);
        foreach (var exc in ex.Flatten().InnerExceptions)
        { …
Run Code Online (Sandbox Code Playgroud)

c# logging task-parallel-library visual-studio-debugging async-await

2
推荐指数
1
解决办法
672
查看次数

服务器端调试期间的 Sys.WebForms.PageRequestManagerTimeoutException

通常,在调试在 ASP.NET 部分 postack(UpdatePanel、具有 AJAX 行为的其他控件)内部执行的服务器端 VB.NET/C# 代码期间,我会收到以下客户端错误:

调试错误

此时我不关心客户端(并且在运行时这不会发生)。这只是调试过程中的一个主要烦恼 - 有没有办法防止它?

asp.net debugging partial-postback visual-studio-debugging

2
推荐指数
1
解决办法
7764
查看次数

"无法在Visual Studio 2012调试模式下评估表达式"

我的Visual Studio 2012安装意外地开始在调试模式下观察变量的任何地方显示消息"无法评估表达式".

我已经尝试更改一些调试设置,正如一些修复程序所提出的那样,但问题仍然存在.

其他一些修复建议我们重新安装visual studio,我不想这样做.我们还能做些什么来修复它?

visual-studio visual-studio-debugging visual-studio-2012

2
推荐指数
1
解决办法
5204
查看次数

Visual Studio 2015 intellisense在调试期间不出现

当我使用手表时,我收到以下错误消息:

Cannot obtain value of the local variable or argument because it is not available at this instruction pointer, possibly because it has been optimized away.
Run Code Online (Sandbox Code Playgroud)

这真的很奇怪,因为我只能在应用程序的某些部分获得intellisense.这个问题最初是在我无法进入我的方法时开始的,所以通过搜索.我在调试器中关闭了我的代码选项.

到目前为止,我尝试过:

  1. 重启机器
  2. 清洁+重建VS2015
  3. 我已经关闭了所有调试优化

我不知道该怎么做.有人可以帮忙吗?

编辑:

代码发生的地方:

 public IList<string> PopulateFilterList(string selectedFields) {
            IList<string> ExcludedFields = _homeRepository.GetExcludedFields();
            Type t = typeof(Invoice);

            return null;
        }
Run Code Online (Sandbox Code Playgroud)

我只是想看看 t

编辑:如果我在调试器中检查选项'抑制模块加载时的JIT优化',我会得到智能感知.我得到了智能感知

c# visual-studio-debugging visual-studio-2015

2
推荐指数
1
解决办法
2002
查看次数

如何在 Visual Studio 中选择启动对象?

有三个 cpp 文件,如果我开始调试,则会出现一条错误消息:“选择启动对象。”

所以我点击了“当前文档”,但没有任何改变。

有些人说右键单击解决方案并转到“属性”,但我找不到“属性”菜单...如何选择启动对象?

c++ visual-studio visual-studio-debugging

2
推荐指数
1
解决办法
1万
查看次数

写入 Visual Studio 输出窗口,万无一失的方式

与“写入 Visual Studio 的输出窗口? ”中所问的完全一样,但是解决了剩余的问题——

  • 我假设如果我在没有调试(ctrl-f5)的情况下开始,就没有办法写入输出,对吗?– previous_developer 2012 年 2 月 27 日

  • Debug.WriteLine() 仅在 Debug 中运行时才有效。这意味着使用 F5 而不是 CTRL-F5 运行它。– kirk.burleson 2013 年 7 月 15 日

然而,事实并非如此,因为:

  • 刚刚在这里运行了一个小应用程序,对我来说很好用。也许您的环境中存在小故障?– Bhargav Bhat 2012 年 2 月 27 日

  • 而且,

在正常运行期间,我可以在 Visual Studio 输出窗口看到一些信息打印:

[1/10/2018 11:56:25 AM Informational] ------ Run test started ------
[1/10/2018 11:56:26 AM Informational] NUnit Adapter 3.9.0.0: Test execution started
[1/10/2018 11:56:26 AM Informational] Running selected tests in  ...\Demo.dll
[1/10/2018 11:56:26 AM …
Run Code Online (Sandbox Code Playgroud)

c# debugging visual-studio visual-studio-debugging

2
推荐指数
1
解决办法
5168
查看次数

表达式:无法增加值初始化的迭代器(调试时出错,但不在发布模式下 - Visual Studio)

我的问题是我的代码的某些部分在发布模式下运行没有问题,但在调试模式下出现错误。

设置:C++ 17 - Visual Studio 2019

为了显示差异,我写了一个小测试代码:

int main()
{
   //Vector containing 20 lists with length of 10 each. Every Element = 10
   std::vector<std::list<int>> test(20, std::list<int>(10,10));

   std::cout << test[6].front() << std::endl; //test if initialization worked

   std::list<int>::iterator test_iter;
   for (test_iter = test[6].begin(); test_iter != test[6].end(); test_iter++)
   {
       std::cout << *test_iter << std::endl;
       test[6].erase(test_iter);
   }
}
Run Code Online (Sandbox Code Playgroud)

在发布它工作正常

但是在调试中我得到了这个

有谁知道为什么两种模式之间存在差异以及我如何调整它,因此调试模式也能正常工作?

提前感谢您的帮助!

最好的问候大卫

c++ list vector visual-studio visual-studio-debugging

2
推荐指数
1
解决办法
175
查看次数