I recently started learning C# and found quickly that one exception was not being thrown when I ran my project. The tutorial I was watching mentioned that exceptions work differently in the Release configuration then they do in the Debug configuration so I figured I must be running with the Release configuration.
I found an article on Microsoft's site that indicates how to switch configurations, however I must be missing something in the instructions because I still cannot figure out how to switch settings.
I'm using Visual Studio Express 2010 for C#. Could someone tell me why the exception below is not being thrown and how to fix it?
Here is the code I'm using:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ReallySimpleLifeCounter
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_testLabel.Content = "Working";
throw new Exception(); //not being thrown
}
}
}