Search code examples
c#winformsc#-4.0backgroundworker

c# application working on development machine, fails on non-development machine


this problem has me baffled.

I'm writing an application which is supposed to take information from a form, pass it to a background worker which then a) writes the information to a local xml file and b) inserts the information into a remote MySQL database.

On my development machine, it seems to work flawlessly. The remote database is updated, the xml file is created if necessary and updated if it already exists. It's working.

Even if I exit out of the development environment and run the release build independantly of the IDE sandbox, the code works.

But, if I put it on another machine, the code fails and I dont understand why.

I'm currently using Visual Studio 2010 Professional on a 32 bit Windows 7 Ultimate machine.

At the moment, I'm finding that the application is stopping at a fairly specific point, which seems to be precisely where the background worker starts doing things like accessing the file system or accessing the remote database.

The project consists of a single exe file and a dll, which has a custom control I designed in it. The custom control is working fine, in that it shows what I want it to and returns the values I'm asking it to when I want it to, so it would seem that isn't to blame.

I initially thought I could be looking at a permissions problem, but running the application as administrator gets me the same response.

I've been writing using version 4 of the .NET framework, however I've just downgraded that to version 3.5 in the hopes that that may help. Both the non-development machines I've tried have been up to date - or have been brought up to date by me - prior to attempting to run the application.

I'm honestly baffled here. Any suggestions would be most welcome.

Alan


Solution

  • If your code fails, it most likely means there is some uncaught exception. What you should do is to log all uncaught exceptions (and probably some of the caught too) to a file, possibly using something like log4net.

    I don't think we can help you beyond that.