views:

94

answers:

2

My C#, .NET 4, app runs fine on XP (media centre to be exact - don't ask).

On Windows 7, it installs fine, but immediately borks. It complains about a NullReferenceException in the callback of a background worker. (I'd love to give you more information, but short of installing VS on the target machine, this is all I can get.)

So, anything I should know about deploying to Windows 7?

Edit: As requested, here's a better description of what's going on... When the main form of my app initialises, it uses a background worker to create an instance of a logging class. When the logging class is created, the worker's callback uses the log instance to add a new entry.

A: 

You are trying to access a resource that can't be created. Do you happen to have a stacktrace or a better description of what this app actually does?

spinon
No stacktrace, but see my edit. Thanks.
Tom Wright
@Tom, why no stack trace? Because that would be superhelpful.
Isaac Cambron
Because I'm an idiot and didn't grab one when I had access to the Windows 7 machine. :)
Tom Wright
+7  A: 

Like I commented, this is most likely a case of privileges (and it will break on Vista too).

It should be OK to write to an eventlog, but a restricted (normal) user cannot create an EventLog.

You may be able to workaround by pre-creating the EventLog with another Tool. But some (XP-minded) software thinks it's a good idea to always create the Log. Wrong.

Standard solution is to create the source from your setup.exe

Henk Holterman
Thanks Henk, I think this is probably it.
Tom Wright
Hate to be a pest Henk, but do you think you might look at this subsequent question? http://stackoverflow.com/questions/3176502/will-this-code-create-an-eventlog-at-installation-time
Tom Wright