I've added a pdf file to my application as a content, and I'm trying to get it to launch when a button is clicked but I'm not too sure why it doesn't want to work.
Here's the code:
private void AppDoc_Click(object sender, RoutedEventArgs e)
{
try
{
Uri uri = new Uri("/UserGuide_PDF.pdf", UriKind.Relative);
System.Diagnostics.Process.Start(uri.LocalPath);
}
catch
{
MeBox.Show("The file location could not be found.", "Location Not Found", MessageBoxButton.OK, MessageBoxImage.Warning);
}
I get an exception that says "System.InvalidOperationException" Any suggestions?