【问题标题】:Intellitrace display's unknown for variables - c#Intellitrace 显示变量的未知数 - c#
【发布时间】:2017-07-05 21:02:27
【问题描述】:

所以我正在使用一些基本代码测试 Intellitrace,当我查看 itrace 文件时,我可以看到异常但看不到它周围的变量,它们都显示为未知。我不知道这是否是我没有正确检查的东西,但我无法让它们出现。

public partial class MainWindow : Window
{
    public List<User> items = new List<User>();

    public MainWindow()
    {
        InitializeComponent();
    }

    public void Button_Click(object sender, RoutedEventArgs e)
    {
        try
        {
            click("sndafh");
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString() + " " + txtName.Text);
        }
    }
    public void click(string name)
    {
        items.Add(new User() { Name = txtName.Text, Age = txtAge.Text });
        string pName = name;


        Users.Items.Clear();
        Users.ItemsSource = items;
        Users.Items.Refresh();
    }
}


public class User
{
    public string Name { get; set; }

    public string Age { get; set; }
}

Snippet of VS 2015 with unknown variables

【问题讨论】:

    标签: c# wpf intellitrace


    【解决方案1】:

    确保您已选择Tools-&gt;Options-&gt;IntelliTrace-&gt;IntelliTrace Events 下的“IntelliTrace events and call information”选项。

    有关详细信息,请参阅以下 MSDN 文章。

    Visual Studio 2015 - 使用 IntelliTrace 更快地诊断问题: https://msdn.microsoft.com/en-us/magazine/dn973014.aspx

    【讨论】:

      猜你喜欢
      • 2014-03-25
      • 2015-01-06
      • 2021-03-07
      • 2016-04-03
      • 2017-08-22
      • 2011-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多