Re: Saving config file - System.UnauthorizedAccessException



Hi,

"David++" <David@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E00B8050-0C05-42BE-943A-1391FD0797CF@xxxxxxxxxxxxxxxx
Hello,

I think the reason I was having this problem was due to the configuration
file (which contains appSettings) is read-only. However, as the client
didnt
want user settings written to a local computer and wanted just an exe and
one
local config file I had to manually create a new config file for any
changes
to the application settings and then refresh the settings internally by
re-loading these settings using ConfigurationManager. Strange I am able to
overwrite the exisiting config file with a new one, but not able to edit
and
save changes to it. Still it seemed to work ok, thank god!

I guess the account you used to overwrite the file is different from that
one running your wep app. If impersonation is enabled the web app code is
running with the credentials of the client, so that gives even more options
for a client being able to not update those settings. As long as the
ConfigurationManager class is used it is reading the settings from a cached
in memory version, so the file access has been executed at app start. It has
been a while since I read this, so I do not remember all the details, but
the documentation in MSDN has quite some stuff in there and there is also a
good book from WROX about aspnet 2.0 security.

--
SvenC

Best,
David


.



Relevant Pages

  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.internet.netmeeting)
  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.win32.programmer.tapi)
  • Re: how to read application ".config" file in No-touch-deployment
    ... "plumbing" to be done (i.e. reading .config through web-service). ... So, you can, on starting your app, see if you ... > have a local XML file that contains settings. ...
    (microsoft.public.dotnet.general)
  • RE: Publish to External FrontPage Server
    ... meaning Auto config, use proxy I am able to connect to the remote website. ... How can I make this work without having to disable the IE settings everytime ... Publish to External FrontPage Server ...
    (microsoft.public.isa)
  • NewB question on maintaining config files
    ... with app settings that control the behavior of the app on that box. ... We are spending lots of time switching out config settings on those boxes, ...
    (microsoft.public.dotnet.csharp.general)