开发者

Getting exception while hosting asp.net web application using MS access .accdb as backend in IIS

I created asp.net web application which is using MS access .accdb database as backend. I have hosted this application in my local IIS and it works fine. When hosting to dev server, i m geting following exception:

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry access is not allowed.

I googled it, tried to add trust level but none of them works. Possible difference between my local machine and dev server is that Microsoft office 2007 is not installed there. Can it be reason for this error? following is my connection string:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Test.accdb;Persist Security Info=Fa开发者_运维技巧lse;"


By default the ASPNET Windows account is used to access ASP.NET resources through the Aspnet_wp.exe process. This account is less powerful, compared to the IUSR_ machinename guest Internet account used by classic ASP for example. In certain situations you might want to use the anonymous IUSR_ machinename account, as the account accessing your ASP.NET application and you can do that by using the following code in your Web.config file:

<system.web>
  <identity impersonate='true'/>
</system.web>

Impersonation is the act of ASP.NET executing code in the context of an authenticated client (Windows account).

Impersonate is the ability to control the identity under which code is executed. Impersonation is when ASP.NET executes code in the context of an authenticated and authorized client. By default, ASP.NET does not use impersonation and instead executes all code using the same user account as the ASP.NET process, which is typically the ASPNET account. This is contrary to the default behavior of ASP, which uses impersonation by default. In Internet Information Services (IIS) 6, the default identity is the NetworkService account. from MSDN

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜