0

I'm using ReactiveUI in my WPF program, the WPF Window can be initialized and show normally, and I'm under Debug Mode,

but sometimes When I run some command code binding with button, it shows error below, and there're not more information, so I have no idea what's the reason to the Exception:

ReaciveUI.pdb contains the debug information required(...)

enter image description here

and after Continue, a window shows then the program was stopped:

An unhhandled Exception of type 'System.Exception' occured in ReactiveUI.dll

enter image description here

How to deal with this problem?

yu yang Jian
  • 6,680
  • 7
  • 55
  • 80
  • 1
    My suggestion - read the entire message box (screenshot you included in the question). Specifically, the last sentence: _To prevent this, Subscribe to the ThrownExceptions property of your objects_. – pmbanka Jan 13 '16 at 08:34

2 Answers2

0

I found the keypoint of the problem later, the bug happens at

BtmCheckCmd = ReactiveCommand.CreateAsyncTask(
                canBtmCheckCmd,  //CanExecute
              async _ =>//Execute
              {
                  ProgressWinDow.RunCheckAndBarHandle();

                  MessageBox.Show("SomeThing");
              }

I find a new way to check whrere the problem I former don't know so later I could found the solution.

In my case when the exception before happens, sometimes the messagebox show (sometimes not), then if the messagebox show, somtimes after click OK and the Exception Window Show, and if doing like this I can't find which part of my code does the problem haapen,

but if I click pause when the messagebox show(not click OK, but click pause under debug mode when msgbox show), then it go to the part of code it execute,

enter image description here

and by doing this I find the "Messagebox show" is in the code block of

async

in the part of code, and there're two method in async, so it should be the reason to this problem, maybe something wrong when async two method at the same time.

And In my case, the Messagebox is originally just used to test, so I delete the MessageBox and the problem solved.

Another way to find the problem in multi-thread is under debug mode,

and set the break points, then execute that part of code, when going into a break point, then go to the top ToolBar select :

Debug>>Windows>>Threads

enter image description here

then in the threads window can see what are the threads doing

yu yang Jian
  • 6,680
  • 7
  • 55
  • 80
0

In my case Visual Studio (2022) had locked a file. To locate the locked file I did (in a console at the root of my project):

git clean -xfd

This gave me a message about several files which VS was locking.

But ultimately, the solution was to kill Visual Studio, perform a git clean, and then rebuild. You may also need to log out if on Windows to release the locked file(s) before rebuilding.