MessageBox.Show not working at all

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

And I worked a lot with MessageBox.Show() , and all the time it showed the PopUp message as I wanted, but then it suddenly doesn’t show anything, I debug the application, the code works fine and compiles the line MessageBox.Show("Something"); but he does not appear!

I also tried to put it on another page, it doesn’t work either! All I remember is that yesterday I messed up the Project Links But is there a problem?

In any case, here is a photo of my project links

References

+6
source share
3 answers

When you create a Windows Phone project, it automatically creates all the necessary dependencies for you. You should be able to in your class file and add the following using statement:

 using System.Windows 

Once you do this, you can implement the MessageBox class. If not, you will need to do the following:

  • Open Solution Explorer
  • Help Folder Right Click
  • Add link
  • Go to builds
  • Go to Overview
  • Go to: C:\Windows\Microsoft.Net\Assembly\GAC_MSIL\PresentationFramework
  • PresentationFramework.dll Link

After you specify this library, you can call: MessageBox.Show(@"Something"); without a hiccup.

+4
source

Solved!

1.) Restarted the computer.

2.) Remote application from the phone

3.) Debugging

+1
source

I had a problem with MessageBox.Show() which did not work.

This happened on two different pieces of software: Kaxaml and an example from Troelsen's C # book.

I complicate this by simply using a simple line inside Show() instead of the Exception delegate in different places in the code, and this helped me to say that I had the correct links. Obviously, if MessageBox worked at all anywhere in the code, it tells me that I have the correct links.

Basically, what happened was a Visual Studio debugger that would run before catch-try blocks, preventing a MessageBox from appearing. When I used the Release version, I would not have a MessageBox.

That this was done by simply disabling the small window that was said in Visual Studio, something like "Do not show this exception." It’s kind of strange that Visual Studio still threw an exception error, although it was in a catch-try block, but whatever it was, it worked for me.

0
source

All Articles