running application on vista

S

sonali_reddy123

Hi all,

I have encountered a problem on running my vb.net application on vista.

The problem occcurs while writing the data to xml which I create in my
application path.
It fails to modify the xml and gives error as failed to write the data
to xml.


Same scenario works on other PC's who are not having vista.


The other thing is that if I set my application to run as an
administrator then this problem won't
occurs.


How should I resolve this issue. I can never expect that whoever is
using my application will run
it as an administrator.


What should I do in this case? Can I somehow run my application having
admin rignhts so it will
be able to do whatever it requires or is there something more to it.


I know that on vista file,folder and registry entries are securable
objects so have an restricted access to work on.
 
J

Jeff Gaines

On 20/12/2006 in message
<[email protected]>
The problem occcurs while writing the data to xml which I create in my
application path.
It fails to modify the xml and gives error as failed to write the data
to xml.

Vista has tightened up on security considerably - an ordinary use will not
be able to write to the Program Files directory.

You should place your XML file in an appropriate place that the user can
write to - somewhere in C:\Users\name for example. (You could use the
registry but I think modern thinking seems to be to use separate config
files). I don't know yet where the recommended location is for such files,
perhaps somebody could comment?
 
J

Jeff Gaines

Good call so far. The recommended folder for user settings is
System.Windows.Forms.Application.UserAppDataPath
for common application settings:
System.Windows.Forms.Application.CommonAppDataPath

Thanks Ciaran :)

Knew it would be there somewhere...
 
J

Jared

This is not good enough for live updating!

How would you go about live updating components?
 
J

Jeff Gaines

This is not good enough for live updating!

How would you go about live updating components?

Not sure quite what you mean?
If you mean transferring existing settings then you would need to read
from the old location and write to the new.
This is going to catch out a lot of people who kept data in Program Files,
that's always been a no no but a lot of people did it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top