0

In one of my projects i am adding a reference to another project which contains a rehosted designer for WF4. My scenario is as follows: 1. Load a worklflow from an existing xaml file. 2. Throw an exception in my main application.

At this point, i got a nice message box with title "Workflow Designer" and with the full stack trace of the exception. It's like when loading that workflow into it's designer surface, a mechanism starts somewhere which handles my entire app.

I have to mention that, without loading the workflow from the xaml first, when throwing the exception, my app will crash.

I cannot understand how is that possible, what's the thing in that other project that takes care of my entire application exceptions handling..

enter image description here

As you may see in this pic, the exception is thrown at : AEE.Tools.Unicom.Frames.ByteFrame.Assign method. Indeed i don't have a try catch there and it would be normal for my app to crash.

I have this in my Output:

 A first chance exception of type 'System.NullReferenceException' occurred in AEE.Tools.UnicomNeEva.dll

 The thread '<No Name>' (0x2c50) has exited with code 0 (0x0).

 Step into: Stepping over non-user code 'MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen'

Does anyone know if i can stop this from interfering ?

Olaru Mircea
  • 2,570
  • 26
  • 49
  • Trying to use a "null reference" is a code error. Or you deal with the exception in the case you are reading something dynamically that can throw this, or you chnge your logic so this do not happens. – Jauch Dec 05 '14 at 16:42
  • @Jauch I am introducing that expcetion there for testing, the nasty thing is what\who catches my exception ? Indeed i will get rid of that null ref now, but in the future, any unwanted thing will be shown as a workflow designer error.. and that would not be true .. – Olaru Mircea Dec 05 '14 at 16:48
  • Well, I would say that the process that loads the workflow from the xaml file handle exceptions (not the other app), and when you do not use it (laoding directly from the file, it's up to you to handle exceptions. No? – Jauch Dec 05 '14 at 16:55
  • @Jauch yes, something like that, but what kind of operation is that, how is this possible? In fact, i am just loading an workflow from a xaml file, i am not launching the supreme guard .. – Olaru Mircea Dec 05 '14 at 17:00
  • Hum... The first exception happens when you try to add the reference to the project? – Jauch Dec 05 '14 at 17:03
  • @Jauch I am instantiating the WorkflowDesigner without an issue, all works fine in the rehosted project. It might be a special case here, it's weird for sure, but i am wondering, what in the world could decide to catch my exceptions from other sections of my application? – Olaru Mircea Dec 05 '14 at 17:07
  • 1
    Code in your designer will execute when loaded into the design surface. Look at the call stack. Solution is not to do that. –  Dec 05 '14 at 17:24
  • The exception is being displayed by the designer. – DotNetHitMan May 08 '15 at 11:59

0 Answers0