Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) - How do I resolve?

Asked

Viewed 1,950 times

-1

The site only gives error on the server, locally ta ok! Look:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Description: An unhandled Exception occurred During the Execution of the Current web request. Please review the stack trace for more information about the error and Where it
originated in the code.

Exception Details: System.Unauthorizedaccessexception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

ASP.NET is not authorized to access the requested Resource. Consider granting access Rights to the Resource to the ASP.NET request Identity. ASP.NET has a base process Identity (typically {MACHINE} ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool Identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the Identity will be the Anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To Grant ASP.NET access to a file, right-click the file in File Explorer, Choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET Account, and check the boxes for the desired access.

Source Error:

  • Line 1: @{
  • Line 2: Websecurity.Initializedatabaseconnection("Bancodedados", "Table", "Coluna1", "Coluna2", true);
  • What version of MS SQL? 2005 ? What version of IIS on Server?

  • SQL SERVER CE, and the IIS on Server can not say the bad version I think is the latest!

2 answers

1

your ASP.NET on the server is not authorized to run. on the IIS you must give permission. I first put the permission in the folder on the server (Test only put the user Everyone with full permission) the correct is the {hostname} ASSPNET or Iusr_hostname.

Should work.

  • How do I do that?

  • where is running this application? Server? tablet? where is this server?(is it hosting or is it yours?) if it is hosting on the hosting panel there is always a location for permissions.

  • Hosting Server!

  • I found how to change some settings in the file or folder. There is type - > IIS Account (-), I have already given permission where I could in the.sdf file (database) and the error continues. You know what to do?

  • permission in the folder where ASP.NET is located

  • As well as ASP.NET?

  • That that gives not explain right...your question this very 'move' so let’s kick what can help you. Vc didn’t develop a C# application in Asp.net? at least the tags you put were from that. imagining that in the hosting has there folder permissions, I would put execution permission where your Asp.net files are found any case contact the hosting, they will know the problem.

  • Thanks man! yes I did in Asp.net, c#. does the following answer no more. And vote there against (if not already voted), denounces, tries to exclude, I don’t know. blz?!

  • @Glorious, no need to warm up, it was just a constructive criticism.

Show 4 more comments

0

Actually the problem is this:

Sql Ce needs read and write permission in App_data folder.

And it also needs read and run permission in the binary files that are in the amd64 bin and x86 bin folder, which is the folder where the SQL CE DLL’s are.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.