2

I have an asp.net application. There are secret parts contained in the web.config file which I want to protect through encryption. I'm using the ConfigurationSection.SectionInformation.ProtectSection method and later using WebConfigurationManager.Save to save it. Locally it works OK.

The problems is when it runs on the server, I get this error:

System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: (C:\Inetpub\vhosts(SiteName)\httpdocs\web.config) ---> System.UnauthorizedAccessException: Access to the path 'C:\Inetpub\vhosts(SiteName)\httpdocs\rz0fkykb.tmp' is denied.

This problems seems to take place because there is no write permission for the temp file which is obviously being created as part of encrypting the parts in web.config. I don't know the name of the temp file to be created and I don't want to give total write permission to the whole basic directory (security).

Is there a way to configure the path or the name of the tmp file created as side effect of the web.config encryption so I can isolate it and give to it (or to the custom specific directory) writing permissions?

4

1 回答 1

0

<system.web>此代码下设置的 webconfig 文件中

 <identity impersonate="true" userName="your username of your current account"
        password="your  password" />
于 2012-11-04T10:24:32.147 回答