Urgent help::: ASP.Net Access is denied

G

Guest

Hi Friends,

I want to develop a web based app where it will talk to a dll
(which retrieves real time data from a controller)
I've added a com dll reference to my project, the code is something like this:

GEOAuto.OPCServer OPCserver = new GEOAuto.GEServerClass();
GEOAuto.OPCGroup OPCGroup;
System.Object myNode = new System.Object();
object myval;
object myquality;
object mytime;

OPCserver.Connect("GEO Server",myNode);
// here it fails in asp.net, but works fine with Windows Application

on execution (ASP.NET) it gives me error, embedded in lines as:

==========================================
Access is denied.
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.

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) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in 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.
==========================================

I'm using Windows XP, IIS 5.1, VS.NET 2003.
I tried following:
1) In web.config I've added
<identity impersonate="true"/>
2) IIS authentication set up for this web server: Anonymous
3) using Integrated Windows Authentication

But still no results :-(

Anybody knows how to work around this?

Thanks in anticipation,
Sachin M
 
K

kiran

To grant ASP.NET write access to a file, right-click the file in 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.
 
G

Guest

Hi Kiran,

thanks for the reply.
That I've already tried. But I'm not getting any kind of Security tab
whenever I right click on a file (properties) in Windows Explorer.
Can you tell me which file? the dll (to which I've added reference)

Regards,
Sachin
 
G

Guest

The reason you are not getting a security tab is becuase you have "Simple
File Sharing" turned on. To turn this off just open an explorer windows, go
to Tools->Options and click on the "View" tab. In the "Advanced Setting"
section scroll down to the very bottom and uncheck the "Use simple file
sharing" option. Click on Apply/Ok and now when you right click on a file and
go to Properties you will have the security tab.

Hope this helps.

Brian Delahunty
Ireland

http://briandela.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top