title: windows 10 exceptions not including line numbers
body: <p>I have a Windows 10 Universal App that does not include line numbers in the Exception objects .ToString() method.</p>
  
  <p>If I have a method like</p>
  
  <pre><code>private void ThrowException()
  {
      try { throw new Exception("Test"); }
      catch (Exception e) { Debug.WriteLine(ex.ToString()); }
  }
  </code></pre>
  
  <p>When I check the output, I don't see the line number where there exception was thrown. I added a Post Build event to the project:</p>
  
  <pre><code>xcopy $(ProjectDir)$(OutDir)*.pdb $(ProjectDir)$(OutDir)AppX\*.pdb
  </code></pre>
  
  <p>The pdb file is in the Debug folder but not in the AppX folder.</p>
  
  <p>What am I missing? Thanx,</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I created a new project to test this. I have a single page (MainPage.xaml). Here is the code behind file:</p>
  
  <pre><code>using System;
  using Windows.UI.Popups;
  using Windows.UI.Xaml.Controls;
  using Windows.UI.Xaml.Navigation;
  
  namespace App2
  {
      public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              InitializeComponent();
          }
  
          protected override void OnNavigatedTo(NavigationEventArgs e)
          {
              base.OnNavigatedTo(e);
              ThrowException();
          }
  
          private async void ThrowException()
          {
              try { throw new Exception("Test"); }
              catch (Exception ex) { await new MessageDialog(ex.ToString()).ShowAsync(); }
          }
      }
  }
  </code></pre>
  
  <p>As before, I added the post build event macro:</p>
  
  <pre><code>xcopy $(ProjectDir)$(OutDir)*.pdb $(ProjectDir)$(OutDir)AppX\*.pdb
  </code></pre>
  
  <p>I compiled in the Release configuration and insured the "Compile with .NET native tool chain" option is checked.</p>
  
  <p>The Appx folder in C:\VS2015\App2\App2\bin\x86\Release\AppX does have the files App2.dll and App2.pdb present.</p>
  
  <p>When I run the app, I get the following in the popup dialog:</p>
  
  <pre><code>System.Exception: Test
    at SharedLibrary!&lt;BaseAddress&gt;+0x122d16
  </code></pre>
  
  <p>Thanx</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I also tried this in Debug without the native tool chain. In that case, I <em>did not</em> see the pdb file in the AppX folder under Debug</p>
  
  <p>The message in that case was:</p>
  
  <pre><code>System.Exception: Test
    at App2.MainPage.&lt;ThrowException&gt;d_2.MoveNext()
  </code></pre>
  
  <p>Thanx</p>