MessageBox.Show not working at all
Solution 1
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:
- Open Solution Explorer
- Right Click Reference Folder
- Add Reference
- Go to Assemblies
- Go to Browse
- Navigate to:
C:\Windows\Microsoft.Net\Assembly\GAC_MSIL\PresentationFramework
- Reference
PresentationFramework.dll
Once you've referenced that library, you'll be able to call: MessageBox.Show(@"Something");
without a single hiccup.
Solution 2
Solved!
1.) Restarted my computer
2.) Deleted the app from the phone
3.) Debug
Comments
-
GabourX almost 2 years
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 LineMessageBox.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
-
GabourX almost 10 yearsWhere i can add assemblies?
-
GabourX almost 10 yearsFollowed till step 4 , and there's was nothing to choose there Only a message was showen :All of framework assemblies are already referenced . Please use the object browser to explore the references in the Framework
-
GabourX almost 10 yearswent to the Objcet Browser , found
System.Windows
and also foundMessageBox
class -
GabourX almost 10 yearsbut again , The windows in your picture doesn't show any assembly in my computer
-
GabourX almost 10 years2012 Express for Windows Phone
-
GabourX almost 10 yearsI told you , its Targeting : Windows Phone 8.0
-
AMS almost 10 yearsyou cannot add framework assemblies for the windows phone 8 apps. all the framework assemblies are already referenced in windows phone 8 solutions implicitly.
-
Greg almost 10 years@DreamCoder Fixed the answer to better define "steps".
-
GusP about 9 yearsAlong these lines, I ended up just rebooting my phone and it started working again. Apparently, this is a Windows Phone 8.1 bug and not actually a problem with apps that run into this.