Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MessageBox.Show not working at all

I am developing an app for Windows Phone 8 with C#

And I've been working alot with MessageBox.Show() , and All the time it used to show a PopUp message like i wanted , but then suddenly , it Won't show anything , I debugged the app , the code runs normally and compiles the Line MessageBox.Show("Something"); but it doesn't pop up !

I also tried to put it in another page , doesn't work too ! All i remember that yesterday I have messed with References of the Project But is that the problem ?

Anyways here's a photo of the references of my Project

References

like image 324
GabourX Avatar asked May 05 '14 00:05

GabourX


2 Answers

When you build a Windows Phone Project it automatically generates all the required dependencies for you. You should be able to in your class file and add the following using statement:

using System.Windows

Once you've done that you'll be able to implement the MessageBox class. If not, then you'll need to do the following:

  1. Open Solution Explorer
  2. Right Click Reference Folder
  3. Add Reference
  4. Go to Assemblies
  5. Go to Browse
  6. Navigate to: C:\Windows\Microsoft.Net\Assembly\GAC_MSIL\PresentationFramework
  7. Reference PresentationFramework.dll

Once you've referenced that library, you'll be able to call: MessageBox.Show(@"Something"); without a single hiccup.

like image 98
Greg Avatar answered Oct 15 '22 08:10

Greg


Solved!

1.) Restarted my computer

2.) Deleted the app from the phone

3.) Debug

like image 28
GabourX Avatar answered Oct 15 '22 09:10

GabourX