trailmax
trailmax

Reputation: 35126

.Net application deployment: runs only on my machine

I've got yet another deployment problem.

What I have: little Windows Forms application that looks on browser cache and copies image files from there.

The problem: the app runs fine on my machine, but whenever I try to run it on somebody else's machine, I get an error message (something along "error occurred. Exiting" and a list of 3 files in Temp folder. Not much information about the problem in these files.

I've tried with different targeted frameworks .Net 4.0, .Net 4.0 Client Profile, 3.5, 3.5 Client profile - same problem. I have tried OneClick deployment and installation project, and just copy *.exe file. All end up with the same problem.

On target machine full .Net 4.0 framework is installed, but it makes no difference.

The app is reading from registry, but I would not think that reading from HKLM requires admin rights, but I tried running as Administrator anyway.

I've tried Windows 7, XP SP3 - similar outputs.

There are no dependencies for the project, apart from .Net framework.

Any suggestions where I can check what exactly happens with the application on foreign machine??

p.s. the source code is available here, if you wish to have a look: http://cachecopy.codeplex.com/SourceControl/list/changesets

UPD: Thanks for suggestion guys, I've set up Visual Studio on some other machine and found a problem within seconds. I was trying to open directory with String.Empty as address. Silly me!

Upvotes: 0

Views: 1773

Answers (3)

Dot NET
Dot NET

Reputation: 4907

Could it be that at some point you're referencing a file which does not exist on the other machines? For example 'C:\MyFile'?

Upvotes: 2

David C
David C

Reputation: 3810

Basically, either in your application or form load process, some piece of code is trying to perform file operations on an either protected or non existent directory/file without proper error handling.

The trick is to figure out how you are referencing paths/filenames in your application before doing any file processes and decouple them from your specific operating system/username.

Try / Catch with custom errors to help you pinpoint areas would be a good idea around all file system access code.

Upvotes: 1

Andy Arismendi
Andy Arismendi

Reputation: 52689

Sounds like a job for... ProcMon. Run this on the machine while you start your app and filter out everything but your exe. This will show you all file system and registry activity. If there permissions problems you'll see access denied in result column, or if things are missing you'll see path not found entries.

Upvotes: 2

Related Questions