473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

bugs

Recently I've encountered two highly annoying bugs in the framework,
anyone who knows how to solve them would be most appriciated.

1) I'm trying to do Process.Start(url); and get a Win32Exception, after
quite a bit of testing I found out that the reason for this is that I
didn't have STAThread attribute. Process.Start(url) throws when I don't
have an attribute at all, or when I have MTAThrea, anyone can tell me
why?
I looked around, and it seemed that many other people have encountered
this problem. I've the workaround, but I want to know what is going on
here!

2) The following code throw an exception and abort the program, it
shouldn't!

public static void SetExceptionHandlers()
{
System.AppDomain.CurrentDomain.UnhandledException+ =new
UnhandledExceptionEventHandler(CurrentDomain_Unhan dledException);
System.Windows.Forms.Application.ThreadException+= new
System.Threading.ThreadExceptionEventHandler
(Application_ThreadException);
}

public static void HandleException(Exception ex)
{
if(ex==null)
return;
using(DetailedErrorInfo dei = new DetailedErrorInfo(ex))
{
dei.ShowDialog();
}
}

private static void CurrentDomain_UnhandledException(object sender,
UnhandledExceptionEventArgs e)
{
HandleException(e.ExceptionObject as Exception);
}

private static void Application_ThreadException(object sender,
System.Threading.ThreadExceptionEventArgs e)
{
HandleException(e.Exception);
}
[ STAThread()]
public static void Main(string [] args)
{
SetExceptionHandlers();
Test();
Console.WriteLine("Test passeed");

private void Test()
{
throw new InvalidOperationException("Test");
}

There is nothing wrong here as far as I can tell, but it still will give
me the silly default dialog. The whole point is to have a better dialog
there!

3) Not related to bugs, but does anyone knows whatever there is a way to
know at *runtime* whatever this is a debug or release build?
Nov 16 '05 #1
1 1096
Not related to bugs
you can know if you are in debug mode
#if Debug == true
// do some debug logic
#Endif
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mudge | last post by:
Hi, I'm trying to help my hosting company decide whether or not to upgrade to php 5. My hosting company does not want to upgrade to php 5 if it has bugs that would cause problems. So i'm doing...
83
by: kartik | last post by:
there seems to be a serious problem with allowing numbers to grow in a nearly unbounded manner, as int/long unification does: it hides bugs. most of the time, i expect my numbers to be small. 2**31...
3
by: Brett C. | last post by:
Anthony Baxter, our ever-diligent release manager, mentioned this past week that Python 2.3.5 will most likely come to fruition some time in January (this is not guaranteed date). This means that...
4
by: Alex Bell | last post by:
There have been several postings recently dealing with bugs in Internet Explorer. Can anyone point me to a review of these bugs and how to work around them? Regards, Alex
20
by: Prashanth Badabagni | last post by:
hi, i'm prashanth Badabagni .. Can anyone tell me the BUGS present in C language whether programming or syntactical BUGS .... Thanks in advance ... Prashanth Badabagni
9
by: David Teran | last post by:
Hi, we are currently using another database product but besides some licensing issues we are finding more and more problems with the database. We are evaluating PostgreSQL and it looks quite...
2
by: TheSteph | last post by:
Using : Windows 2000 Pro SP4 / VS.NET 2005 / .NET 2.0 / C# - All updates done. I have several bugs when I use the DataGridView : When scrolling (or after scrolling) the grid have these...
19
by: Alan Silver | last post by:
Hello, Having discovered what I believe to be two CSS bugs in IE7, I have submitted bug reports to MS. AFAIK, these don't get acted on until they receive votes form others to say they are worth...
15
by: Gary Peek | last post by:
Can anyone tell us the browsers/versions that exhibit errors when tables are nested too deeply? And how many levels of nesting produces errors? (not a tables vs CSS question)
87
by: CJ | last post by:
Hello: We know that C programs are often vulnerable to buffer overflows which overwrite the stack. But my question is: Why does C insist on storing local variables on the stack in the first...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.