-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper handling of .NET exceptions #164
Comments
Thank you for your quick reply. What I want to know is, how could I get the details of the exception when an exception happens? In my case, Python only tells me the following:
A Visual Studio debugger cannot catch any exception either. It really took me too long to diagnose when such problem happens. |
upd. I forgot to clarify, that the mentioned problems and other such as seh and some memory violation are typically outside the module under debug: |
Thank you very much for providing me such solutions! I have finally solved this problem. I want to write up some tutorial for catching any
|
We're talking about different problems! Your initial issue points to #94. You just voiced about "to catch any annoying exceptions" while initially it was "If there were any way to catch these exceptions" (your src points exactly to #94 issue) But finally your latest post points to this issue: 3F/coreclr#3 |
Well, I see :) mixed problems. My thoughts, as I said, were about seh and some memory violation or like, for the term of "these" (because of src). Still a duplicate, thus please read all related issues above. |
Yes. Let me clarify for readers in the future, all the problems I have met were:
Finally, my solutions are to:
No problems about SEH / access violations, I believe. At last, thank you for all your hard work! |
UPDATE: My problems are solved. For a quick outline of my problems and their solutions, see my last comment.
AFAIK, the current behavior when a .NET exception is caught, is to simply raise a Win32 exception with code
0xe0434352
. It is hard to know the details of the exception, which makes debugging very difficult.I'm currently having a hard time debugging a C# shim which is expected to be called from Python. It could be a lot more handy if I could know the details of the exceptions.
My story:
I was unaware that .NET assemblies should be put in the same directory as the executable file (putting them in the current directory or
%Path%
did not work). So I always get a0xe0434352
whenever I call any of the[DllExport]
functions. I tried hard to rearrange my code and see if anything changes, but without success. Finally, by using .NET reflection, I realized that I should try to add the current directory to the .NET search path, using the instructions on Stack Overflow.Currently, I'm facing another problem, that I'm unable to call a
[DllExport]
method from another[DllExport]
method (I realized that by changing my code). For example, the following code did not work:If there were any way to catch these exceptions, it could be really helpful.
Anyway, thank you very much for making this library, it is really amazing when it works.
The text was updated successfully, but these errors were encountered: