title: Showing a Windows 10 toast notification
body: <p>I'm developing a program in C# (Visual Studio 2015) and I want to show a toast message to the user at a certain situation. I downloaded this code from the MSDN and it runs fine:</p>
  
  <pre><code>// Get a toast XML template
  XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText04);
  
  // Fill in the text elements
  XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
  for (int i = 0; i &lt; stringElements.Length; i++)
  {
      stringElements[i].AppendChild(toastXml.CreateTextNode("Line " + i));
  }
  
  // Specify the absolute path to an image
  String imagePath = "file:///" + Path.GetFullPath("toastImageAndText.png");
  XmlNodeList imageElements = toastXml.GetElementsByTagName("image");
  imageElements[0].Attributes.GetNamedItem("src").NodeValue = imagePath;
  
  // Create the toast and attach event listeners
  ToastNotification toast = new ToastNotification(toastXml);
  toast.Activated += ToastActivated;
  toast.Dismissed += ToastDismissed;
  toast.Failed += ToastFailed;
  
  // Show the toast. Be sure to specify the AppUserModelId on your application's shortcut!
  ToastNotificationManager.CreateToastNotifier(APP_ID).Show(toast);
  </code></pre>
  
  <p>After testing this code I wanted to implement it into my application. So I changed it up a little bit and tried to run it. The error messages: </p>
  
  <blockquote>
    <p>The type "IReadOnlyList&lt;>" is defined in a not referenced assembly. Add a reference to System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    (translated)</p>
  </blockquote>
  
  <p>Same goes for <code>IEnumerable&lt;&gt;</code> and <code>IReadOnlyList&lt;&gt;</code></p>
  
  <p>The error come from these two lines:</p>
  
  <pre><code>for (int i = 0; i &lt; stringElements.Length; i++)
  {
      stringElements[i].AppendChild(toastXml.CreateTextNode("Line " + i));
  </code></pre>
  
  <p>I also tried adding the reference to System.Runtime. I downloaded it with NuGet (<a href="https://www.nuget.org/packages/System.Runtime/4.0.0/" rel="noreferrer">https://www.nuget.org/packages/System.Runtime/4.0.0/</a>). 
  After that the errors were gone, but now literaly <strong>every</strong> word in my code is cringled red with error like "System.Object is not defined" and so on (but it still runs when I start it!). </p>
  
  <p>The only possible solution I can think of is that System.Runtime is already installed somewhere on my computer, and that 4.0.0 is the wrong version for my program. But I can't find it anywhere. </p>
  
  <p>PS: It's a desktop-application, not a Windows-Store application.</p>