Events not triggering within the Citrix enviroment
I'm developing several automations inside the citrix enviroment (by using the Citrix Context). Whenever I test my automations I notice that events are never triggered. When I use the WaitForCreate method for the same component, the result is a true (so the component actually is created).
For further investigation of the problem, I tested the "WaitForEvent", so I could force my execution line to go through the component. When the execution line reaches the WaitForEvent I get the next error:
"The type Openspan.Automation.WaitForEvent in assembly OpenSpan.Automation, Version 18.104.22.168, Culture=neutral, PublicKey Token= ... is not marked as serializable."
Any idea how I can fix this problem? Developing a solution without any events is not optimal. Thanks in advance.
Thanks for your answer! This was actually the solution for me.
All the automations within my solution are actually outside the Citrix Context. I just made a new automation within the Citrix Context and added the "Created" event. This time it did trigger.
This raises the question for me: when I have a solution with a single windows adapter within the Citrix Context, do I always place all automations within the Citrix Context? Or just the automations with events?
Thus far I had no problems when running the automations from outside the Citrix Context (except for events not firing).
Running a Citrix context has a few limitations. In general, I would suggest you treat it like a separate project (although it cannot be a truly separate project). Have each automation do its thing and then return any results. You would then call those automations from outside of your context and handle the inputs/outputs.