By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,881 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,881 IT Pros & Developers. It's quick & easy.

access denied using a dll that calls a com object

P: n/a
This is the first time I have tried this. What we have is a com object the
generates keys. A developer here wrote a .Net wrapper in C# for this com
object. I am trying to call her dll wrapper with my ASP.NET page and I get
an access denied error. I can use the test Windows Form just fine, but not
my ASP.NET form. This is all local to my machine. The error is below.


Here is the error that I get:

Server Error in '/LicManage' Application.

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.

Source Error:
Line 25: String connectionString = "Persist Security Info=False;User
ID=sa;Pwd=mtdew;database=vantive;server=crmdev;Con nect Timeout=30";
Line 26:
Line 27: ActivationCodeLibrary.ActivationCode a = new
ActivationCodeLibrary.ActivationCode(connectionStr ing);
Line 28:
Line 29: a.AddRegistrationKey(txtRegKey.Text,false);
Source File:
c:\webprojects\vwright_view\web\licmanage\licmanag e\test.aspx.cs Line: 27

Stack Trace:
[UnauthorizedAccessException: Access is denied.]
ActivationCodeLibrary.ActivationCode..ctor(String connectionString)
LicManage.test.Page_Load(Object sender, EventArgs e) in
c:\webprojects\vwright_view\web\licmanage\licmanag e\test.aspx.cs:27
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a

Hello Vincent,

I'm having the exact same issues - I wonder, have you found a


Posted via

Jul 22 '05 #2

P: n/a
jdall wrote:
Hello Vincent,

I'm having the exact same issues - I wonder, have you found a

If it's the exact same issue, then you should post to the aspnet group. This
one's for classic asp ...

You probably need to grant permissions for the dll to the aspnet user
account on the web server.

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
Jul 22 '05 #3

P: n/a
I used impersonation and gave that user rights to the dll.
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.