Robert6327

I am taking my first stab at writing an application in C#.

My App is designed to watch a folder and report any created deleted or modified files.

I created a simple form where changes are wrtiiten to a textbox, and concequently to a log file. I used the FileSystemWatcher Object, and wrtie to the text box and log file on the change events.

This application runs fine on my XP machine, but fails to even launch on my 2003 server. I tried just a normal form on my 2003 server and it ran fine. Anything that could point me in the right direction would be great.

Thanks




Re: Visual C# General Why Won't My App Run on Windows 2003 Server?

frederikm

Hi

it could be that
- you are missing some dll's specific to you application...
- there are some security constraints
- ...

what is the startup code of your application

Could you modify your code to open a form, and by clicking on a button to execute your code, thus hopefully getting an error message

also, did you install your app, or just do copy paste of an exe






Re: Visual C# General Why Won't My App Run on Windows 2003 Server?

Robert6327

My Application Starts by Launching the Form. I recieve an Error Message that states.

FolderWatcher has encounter a problem and needs to close. We are sorry...

When I first tried it I did get an error in the windows even log, but now it is not there any more.

It stated:

Source: .Net Runtime 2.0 Error, Category: None, Type: Error, Event ID 5000, USer:NA

Event Type clr20r3, P1 folderwatcher.exe P2 1.0.0.0 P3 45b53d29, P4 system, P5 2.0.0.0, P6 4333ae87, P7 35e3, P8 60, P9 system argument exception, P10 NIL

I have tried this on 2 different windows 2003 servers and 2 different XP boxes... always works on xp, but not on 2003 server.

I reinstalled the 2.0 .Net framework, but this did not help.

When I built the app I chose Publish App, which create a setup.exe and some other files. I ran this and it installed fine.






Re: Visual C# General Why Won't My App Run on Windows 2003 Server?

RizwanSharp

Robert6327 wrote:

Source: .Net Runtime 2.0 Error, Category: None, Type: Error, Event ID 5000, USer:NA

Event Type clr20r3, P1 folderwatcher.exe P2 1.0.0.0 P3 45b53d29, P4 system, P5 2.0.0.0, P6 4333ae87, P7 35e3, P8 60, P9 system argument exception, P10 NIL

There is some ArgumentException but I'm amazed that why does it not show up on Windows XP. To know the exact reason and origin of the reason, please put the following code and see what's casuing that error.

AppDomain currentDomain = AppDomain.CurrentDomain;

currentDomain.UnhandleException += new UnhandledExceptionEventHandler(UnhadledExceptionHere);

private void (object sender, UnhandledExceptionEventArgs e)

{

Exception ex = e.ExceptionObject;

MessageBox.Show("Message : " + ex.Message + "\r\nStack Trace : " + ex.StackTrace);

}

In the above code we have hooked an event to get notified whenever an UnhandledException is thrown. So it'l give you complete exception message + stack trace. Then you can fix your problem.

Note: Putting the above code will still cause an error but atleast you'll be able to see what's wrong before your application gets closed at all.

Best Regards,

Rizwan aka RizwanSharp