Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to have an xml config file that users can modify if they need to and my windows form application can access while running so that it too can read/write to the file.

So I added an app.config file and set to work. It works fine for what I need but when I do a ClickOnce deploy that xml file is not visible or accesible to the user anywhere.

How can I have the user and machine read/write config file and use ClickOnce together?

Wanna-Be C# Superstar
  • Administrators
Posted

The app.config file is really a VS nicety - the file itself should be .exe.config and be within the same folder as the application itself at runtime.

 

By design the app.config isn't designed to be writeable by users as it needs to be in the same folder as the executable and this shouldn't be writeable by non-admins anyway.

 

User settings should be stored as part of the users profile - if you are writting the config file yourself then either isolated storage or Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) will put you in the correct place, under VS 2005 if you are using the built-in settings support this will also be taken care of for user settings.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Humm... The way i have it now I do get appname.exe.config and i can read/write to it from my app. The user can also navigate to the file and read/write to it. I'd like for my clients to be able to have a single version of this config file on the network for all users to read from so a change can be pushed to all of them. Looks like ClickOnce falls on it's face on this one based on some googling about it.
Wanna-Be C# Superstar
Posted
I suppose that would work. In that case though I would not even need the app.config file because I would be hard-coding the network location of the true config file. Based on what I have read if you deploy a ClickOnce app you cannot edit the app.config (even if you can find it) because it is hashed and checked.
Wanna-Be C# Superstar
  • Administrators
Posted
http://blog.gatosoft.com/PermaLink,guid,d0a0dd1e-c9ac-4fa9-a408-615454d49702.aspx might be worth a look, it uses MSBuild tasks to handle such a scenario (and as the article points out deploying to live straight from a development environment isn't a best practice anyway).

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...