2017-07-04 36 views
0

因此,我用一些基本代碼測試了intellitrace,並且當我查看itrace文件時,我可以看到異常但不是周圍的變量,它們都顯示爲未知。我不知道這是我沒有正確檢查的東西,但我無法讓它們出現。Intellitrace顯示器的變量未知-c#

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

回答

0

確保您已Tools->Options->IntelliTrace->IntelliTrace Events下選擇了 「IntelliTrace events and call information」 選項。

有關更多信息,請參閱以下MSDN文章。

的Visual Studio 2015年 - 使用的IntelliTrace診斷問題的速度更快:https://msdn.microsoft.com/en-us/magazine/dn973014.aspx