Windows Forms and Exceptionless Report - winforms

I have started using exceptionless for a windows forms application. Whenever it notices that the program is crashed it throws up this window:
I really do not want it to do this, as I want it to submit the errors to me, with out a user being able to stop it. Is there anyway to do this?

I find it :)
ExceptionlessClient.Default.Register(showDialog: false);
showDialog: Controls whether a dialog is shown when an unhandled exception occurs.

Related

Prevent script errors in web browser control WinForms

I've written a WinForms app to open a webbrowser control, and we use this to fill in a form to submit training course events programmatically from a database (it's not perfect, but it saves a lot of time - and no, the company concerned doesn't support XML feeds). However, the system has just started generating script errors, which prevent it working.
I've tried setting:
WebBrowser1.ScriptErrorsSuppressed = True
but this is only partly successful. The good news is that I don't get any script errors, but the bad news is that I can't then log on to the site.
Has anyone got any suggestions? As far as I'm aware the webbrowser control uses IE, so I can't get it to use another browser instead.
Thanks in advance!
According to the documentation http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.scripterrorssuppressed.aspx if you suppress the errors you also suppress dialog boxes. Meaning Alert Boxes/Authentication used to login will also be suppressed.
Below is what is noted in the documentation:
When ScriptErrorsSuppressed is set to true, the WebBrowser control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set ScriptErrorsSuppressed to false and suppress script errors in a handler for the HtmlWindow.Error event.
As the documentation states, you can handle the HtmlWindow.Error event to allow dialog boxes, but only suppress scripting errors. (Although, I have been having issues with this actually working correctly.)

Exceptions in WPF Word Addin are not being handled

I am creating a WPF Office add in, and I would like to handle all exceptions in one place. To do this I use the following code in the constructor of my MainWindowViewModel:
Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += new
DispatcherUnhandledExceptionFilterEventHandler(HandleAllException);
In my test environment I host the WPF app from a console application project, and exceptions are handled as expected. When I host the WPF app from within word however, nothing happens when exceptions are thrown. There is no notification at all that there has even been an exception, other than in the output window in visual studio. Does anyone have any suggestions as to what I might be doing wrong?
I have solved the problem by changing the way in which I launch my WPF app. I believe the problem was related to this.

vs2010 windows application design-time error

we have a problem with a custom user control in a windows application project.
we use visual studio 2010 (c#).
when we open the design view of a form that includes a custom control, the design view shows the following error:
http://i.imgur.com/Li9qC.jpg
the form belongs to ui.forms while the custom control belongs to ui.controls.
this error appeared suddenly, and even if we revert to an older revision, it still appears.
if we click on "ignore and continue", the first error doesn't cause any problem, but the control "specializzazioni1" doesn't appear in the form anymore.
anyway, at execution time, it appears correctly.
Some times below helps to catch design time errors. Reference
1) Start a second instance of visual studio
2) go the the Tools menu, "Attach to process", select the 'devenv.exe'
process, and click the 'attach' button.
3) In the Debug/Exceptions menu,
Turn on exception catching when first thrown (in the Debug->Exceptions menu).
4) Open the designer with the debugger attached.
5) The second visual studion will break on your error.
Usually when you encounter errors like this in the VS designer it's because an exception is thrown in the constructor of your user control \ form - so i'd check what's going on there to begin with. Maybe you're doing some kind of initialisation that's going wrong ?

Silverlight 4 OOB blank screen

I have a working web application which I want to use as OOB;
However, when I install it, all I get is a blank screen and nothing more...
I also tried without any javascript or HtmlPage.Methods invokes, but still the same
Please help
(A very late reply but the solution wasn't easily available so posting this to help anyone who needs help on this) I was having a problem with the white screen happening when launching OOB apps in debug mode. From lots of searching it appeared that the white screen occurs when an exception is thrown during the application start. Hence the app appearing to load correctly at first and then suddenly going to white screen. I found that the following line of code from the default business app template (from Application_Startup in App.xaml.cs) was causing the exception in OOB mode when using forms authentication:
WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);
Commenting out the line of code immediately made the white screen problem go away.
Make sure you are running the app in debug mode (set it to start in OOB from the project settings and set the project and not the website to be the startup project). If you do that, you should be able to step into where the problem occurs.
(https://forums.silverlight.net/forums/t/190044.aspx)
It's difficult to say what is wrong in your case because you haven't provided any sources, but you can use this article as a reference Building An Out-of-Browser Client With Silverlight 3
Maybe you're trying to interact with page right before InitializeComponent() call in constructor of your main UserControl. If some exception occured before InitializeComponent() then you'll receive blank screen.

Silverlight hangs at 100% loaded

My Silverlight website hangs at 100% loaded. There is no code for it, so far it is just the design in XAML, and it shows up fine in Expression Blend 3. It is the standard "Silverlight Website" project from Blend 3, without any modifications.
When I press F5 to run it, it shows as a 100% loading circle in firefox and never actually shows my app. The loading circle continues to animate as if its doing something.
Note: It worked yesterday, and I havent made very many changes to it since then.
I had this problem in browser, out of browser - even when debugging. Using Silverlight 4 beta.
I hit F5 to start debugging and it never even hit a breakpoint for the constructor of App.xaml.cs.
I knew I'd uninstalled an out of browser app and changed some out of browser settings recently but nothing would tell me the actual problem.
I found in the end if I ran in IE (normally I use Chrome) - then an error icon would be shown in the bottom left - as if it were a javascript error.
Webpage error details
Message: Unhandled Error in Silverlight Application
Code: 2020
Category: ParserError
Message: Invalid Property: OutOfBrowserSettings.
File:
Line: 47
Position: 27
Line: 54
Char: 13
Code: 0
URI: file:///R:/Project/Projece/Bin/Debug/TestPage.html
Well this didn't get me any further - except to tell me something was messed up with OutOfBrowserSettings.
What I ended up doing was creating a new AppManifest.xml. As of Silverlight 4 this is the default AppManifest.xml.
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Deployment.Parts>
</Deployment.Parts>
</Deployment>
I disabled 'create app manifest' and reenabled it. After toggling some of the settings back and forth - and even creating AppManifest2.xml I managed to get it working again.
I switched back to my original AppManifest.xml and it worked.
The point being check any message the browser gives you - and then change things that you don't think will make a difference.
Good luck!
I figured out the problem after looking at the XAML. On the height property of one of my buttons, there was a line break right before the ending quote. Expression blend didn't mark it as an error, and everything showed up fine in design mode.
When I removed the line break, the loading problem was fixed.
My other answer looks quite convoluted compared to this. This may or may not help in this situation but its worth a try:
In Visual Studio :
Click Debug > Exceptions
Click 'Find' and search for XAML
Click the 'Thrown' button next to System.Windows.Markup.XamlParseException
Start your project in debug mode. Any Xaml exceptions will be shown immediately. Check the inner exception sometimes for further information.
I wasted soooo much time before I finally figured this one out!
Here is the answer: http://www.cnblogs.com/101rico/archive/2012/11/14/2769781.html
You can add this: xmlns:Grid="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
This also happens when the Silverlight app requires Silverlight 5, but the user has a lower version installed.
An infinite event loop can cause this problem:
private void myComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
myComboBox.SelectedIndex = 0;
}
If it is an elevated trust application, failing to have the necessary registry settings set to allow its launch can cause the dreaded "100% hang":
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Silverlight
AllowElevatedTrustAppsInBrowser DWORD:=1
AllowLaunchOfElevatedTrustApps DWORD:=1
Open Internet Explorer, go to Tools-> Internet Options->Advanced->click Reset on Reset Internet Explorer Settings-> choose Delete Personal Settings->Click reset
So my problem was, in a data grid, I had a duplicate column name binding to the same column name. So something in the xaml was crazy messed up. Apparently the control I am using had an "Internal Exception" that was not being thrown up on the screen as an error.

Resources