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

Access Denied trying to instantiate a wrappered com object?

P: n/a
I have already used a third party com object in my code,
and it went easily. Add the reference, call the methods,
and get my results.
But I am integrating a legacy com object and I follow the
same steps, the auto complete works, the compiler likes
my code, but when I test, pressing the button that
triggers the code segment gives me an access is denied
error and a stack trace that claims the problem is in my
instantiation. (Error cut and pasted to the end of the
email)

I found some references to the same issue about working
with office from c# as well.

The only difference between teh 3rd party component and
mne is that the 3rd party piece is a dll, and the legacy
code is a exe. And I noticed that all the documentation
specifies that dll's can be wrappered. Is this my issue?
My goal is a stand alone process that does a specific
task outside my thread, so I do not want to have a dll
that runs in my process.

Thank you in advance.

The Error:
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 204: }
Line 205: string jobid = "";
Line 206: MaintenanceRx.CJobRx
JobDel = new MaintenanceRx.CJobRx();
Line 207:
Line 208: if(Request.Form.ToString
() != "")
Source File:
c:\inetpub\wwwroot\processrx\reportrx\configreport s.aspx.c
s Line: 206

Stack Trace:
[UnauthorizedAccessException: Access is denied.]
ProcessRx.Config.btnDelete_Click(Object sender,
EventArgs e) in
c:\inetpub\wwwroot\processrx\reportrx\configreport s.aspx.c
s:206
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
+108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEv
entHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277


----------------------------------------------------------
----------------------
Version Information: Microsoft .NET Framework
Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hey Ben
Were you able to solve the problem? I am getting into the same issue. I have a COM object that I have wrapped inside a .Net dll(no compilation errors there). When I try to invoke a function from the .Net dll via a ASPX page, I get an "Access is denied" error at the point in the .Net dll where an instance of the COM class object is created.
Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.