Using await in CreateChild causes "Cannot wait on monitors on this runtime" #4008
-
Describe the bug Version and Platform Code that Fails Although When the We get the error described. I found this issue which describes improving the message, which makes me believe the exception I am receiving is not expected. Apologies for screenshots, Github refused to format code when opening the issue. Stack Trace or Exception Detail
|
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 11 replies
-
This appears to happen in any |
Beta Was this translation helpful? Give feedback.
-
In its simplest form: Are we incorrect in expected that we should be able to call a |
Beta Was this translation helpful? Give feedback.
-
Hi. Can you share the code of the Regarding the command. I've only used csla 7+ but I think that should be possible. |
Beta Was this translation helpful? Give feedback.
-
Hi @StefanOssendorf, I reduced the Removing all of the caching etc, essentially I get the error on the
|
Beta Was this translation helpful? Give feedback.
-
Ah now I see - I think. |
Beta Was this translation helpful? Give feedback.
-
Thanks @StefanOssendorf , is the below what you meant?
|
Beta Was this translation helpful? Give feedback.
-
Yes. Did that fix the exception? |
Beta Was this translation helpful? Give feedback.
-
@clodewyks you actually want the create to occur on the app server or the client? Your latest code will do the create on the client, and allow the child's create operation method to invoke root data portal operations that do call the server. fwiw, this should all improve with changes coming in CSLA 9, where there'll be async add methods on collections. |
Beta Was this translation helpful? Give feedback.
-
@StefanOssendorf yes it did, thank you! @rockfordlhotka I am comfortable with it executing on the client as the While this change works it would require a fortune of work to convert all uses of |
Beta Was this translation helpful? Give feedback.
Ah now I see - I think.
In your first screenshot. You can't use
AddNew()
from the list. It's internally sync over async. Please try instead an explicit create child call and.Add()
on the list with the new item.