Catch coredll.dll native exception in netcf C# - exception

in a closed dll, i've sometime this exception:
Is possible to catch it?
Windows mobile, netcf 3.5, C#
Thanks.

That's an access violation exception. You can try the SEHException class, but I'm not entirely sure if that's available in the compact framework.
Either way, you'll be better off fixing the issue that's causing the exception.

Related

Visual Studio 2015 - How to stop EntryPointNotFoundException when starting to debug an app?

I am running Visual Studio 2015 on a Windows 7 laptop, and every time I start up an application in the IDE's debugger I am presented with the following exception:
Unable to find an entry point named 'EventSetInformation' in DLL 'advapi32.dll'.
I have found reference to this in the coreclr repository on github indicating this is an API that was added in Windows 8. My case is similar to the github issue, and I can click 'Continue' to ignore the exception and my applications run just fine. However, this is really annoying because I can't just start debugging apps without waiting for this exception to get thrown so I can manually continue past it.
My question is whether anyone knows if I can prevent this exception from breaking in the IDE? This situation is just a nuisance at the moment, but one I'd love to get rid of.
For reference, in this case changing the Exception settings within Visual Studio doesn't seem to change the behavior. Here's screenshots for both enabling and disabling CLR exceptions, along with the exception:
CLR Exceptions disabled
CLR Exceptions enabled
Solution
This is caused by a general debugger option that seems to override any exception-specific setting. As indicated by #John in his answer below, there's a debugger option you disable to stop this behavior. When this option was checked I would get the break point described, but un-checking it stops that and provides what I was looking for:
By the looks of your screenshots, I would guess you have enabled the Debugger option "Break when exceptions cross AppDomains or managed/native boundaries". Go to Debugger->Options and uncheck that option (3rd from the top)
A co-worker just hit this issue and he had to check the 'Enable Just My Code' box found in Tools -> Options -> Debugging -> General along with clearing the check on 'Break when exceptions cross AppDomains or managed/native boundaries'.
See this screenshots, I have enabled the Debugger option "Break when s cross AppDomains or managed/native boundaries". Go to Debugger->Options and uncheck that option . Its work fine.enter image description here

cannot find member on object of runtimetype

I am currently working on a legacy web app which uses newtonsoft.json.dll version 1.3.0 and vb.net.
I added four new fields in the application. This source code is shared by another application and it posts into my application and it breaks it.
See image for error.
[]
The error is:
Could not find member x on object of type runtimetype.
The stacktrace breaks at:
newtonsoft.json.jsonserializer.setobjectmember(jsonreader reader,object target, type targettype, string membername)
I did some research. The folks reportedly solved such an issue by upgrading DLL version and didn't have a direct solution to fixing it via code change. I know its very old and the application is high impact any upgrade has huge ripple. However they are planning a rewrite of the application.
Can someone please share any ideas that i should pursue in order to solve this?.
I am expected to make it quick and under pressure.
https://smugmugc3.codeplex.com/workitem/10024
My problem is very similar to what is described in the link above.
I am going to upgrade my version of json converter after convincing my boss and I see that is the only way out of this problem.
After which I will update this thread if I find issues.

VS2012 doesn't break on exceptions for new project

I added a new console application project to my VS2012 solution.
When it encounters an exception, I get an error dialog, and VS2012 does not break and go to the source line that threw the exception.
The original project that was created together with the Solution does break on exceptions properly, so I think the issue is that the newly created executable is not marked as relevant for breaking on exceptions. (The debugger is "not attached"? I'm not sure if this is the right term)
How can I make VS2012 start breaking on exception in a project?
I am using the Debug configuration, the pdb is being generated.
There is an issue with recent x64 Windows systems when they do not propagate exception properly back to the x64 application when function calls cross kernel boundaries.
There are plenty of posts here on SO and all over the internet about it, for example the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64
You can fight it to some extent by going to Debug->Exceptions and flagging CLR exceptions Thrown column. But note that then VS would break even on the exceptions handled by you.

Catching every exception in Monomac

Does anybody know how to catch all exceptions in monomac?
On windows .net I wrap the run loop in a try{}catch and also use:
Application.ThreadException + AppDomain.CurrentDomain.UnhandledException
It would nice to be able to get crash reports from my new mac software I'm beta testing.

How to disable exception assistant and unhandled exception popup in Visual Studio 2008 Express

I am using Visual Studio 2008 Express and am writing unit tests where there are many expected unhandled exceptions. This cause numerous exception assistant popups to display when running these tests in the debugger.
I have disabled the exception assistant in the VS options, but a different unhandled exception dialog pops up instead. I know it is possible to get rid of these with Visual Studio Professional, but how do you do this with the express edition?
By the way, I am using Assert.Throws instead of the ExpectedException attribute (NUnit), which causes this, but I want to use the Assert.Throws instead. Thanks!
In the Debug menu, go to Exceptions (Ctrl+Alt+E). From here you can tell the debugger not to break when an exception is thrown. Just uncheck all the boxes for the lazy option, or go digging for the specific exceptions you don't want it to break on.
Note however, that this may not be what you want to happen under normal debugging situations, so don't forget to turn it back on later if you're trying to debug something & want to find the exception.
Edit: My apologies, even though it's written several times in the question (including the title), I failed to notice you were talking about the express edition... teach me for skim reading the question. Not sure if the above works or not in express edition, so it might still be worth a try.
Edit 2: Ok, looks like the Exceptions dialog is still available in express edition.
I'll take a guess that you're encountering one of the following:
You're throwing a "special" exception like StackOverflowException that the runtime handles differently from other exceptions.
Your test code creates a new thread, and on that thread an exception is thrown.