The problem is the following: a wpf project was created (using frames and pages). In debugging, everything works stably, but after installation only the main menu is launched, and when you go to the next page, the project crashes. I do not understand why this is happening. There is only one idea: did not correctly indicate the path to the pictures and sounds.

Navigation between pages:

var MainMenuPage = new ViewMainMenu(); MainFrame.Navigate(MainMenuPage); 

Sound connection example:

 MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"..\..\Телефон - Гудки.mp3", UriKind.Relative)); player.Play(); 

Example of connecting pictures:

 friend_call_image.Source = new BitmapImage(new Uri("pack://application:,,,/FriendCall.png")); 

An example of connecting a text file:

 string readpath = @"..\..\Questions.txt"; // путь к файлу с вопросами 

I connected everything in different ways, because I did not find another working method.

  • 2
    Add logging to the project and show the error message, glass trace and so on. Without this, it is useless to advise something, the problem in general may not be in the place where you assume ... - Andrey NOP
  • 2
    Your program crashes after all with some message? What is written there? If you guess the reason, then comment out the questionable places, rebuild the project and check again, can the reason be in a completely different place? - Bulson

0