Access Denied trying to create New Instantance of Object

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

The beginning of my assembly that I am getting the access error from looks
like this.
*********************************
Imports System.EnterpriseServices
Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Data.Common
Imports System.Reflection
Imports System.Data.SqlClient
Imports System.Xml

Public Class AdoHelper
Inherits ServicedComponent

Public Sub New()
MyBase.New()
End Sub 'New
*********************************

When I am in my application and trying to create a instantance of the object
it looks like this.
Private oSql As New DataLayer.AdoHelper

And it throws an access denied error when I use the word "NEW". This
assembly was working fine in my application until I added the
EnterpriseServices assembly so that I can have the object hosted in com+. So
I don't where the disconnect is for me. I know it has something to do with
EnterpriseServices but I just don't what?

Any help would be helpful
 
I have the ServiceComponent setup correctly and the client, but my problem
is when I try to create an instantance of the com+ component I get the
following error.

"An unhandled exception of type 'System.UnauthorizedAccessException'
occurred in mscorlib.dll
Additional information: Access is denied"

I have given the ASPNET user full rights to that assembly and even put the
user in the admin group on my box just in case I missed something, but that
still doesn't work I still get the same error message.

Any help with be appreciated.

Ian
 
Hi Lan,

Which version of OS and IIS do you use?

As for you issue, I think you may try to use impersonate.
Here is a KB Link.
306158 INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/?id=306158

Impersonate will let you use the authenticated user to access the COM+
component.
e.g. you set the Windows Integated authentication in the IIS setting, then
you will use the current logon user to access the webpage, and then access
the COM+ component. You also need to set the logon user the rights to
access the COM+ component.
You may run the dcomcnfg in the run dialog,navigate to the Component
Service/Computer/Mycomputer, right click on the Mycomputer,and select the
default com security tab. Then press the each Edit button and add the
current logon use to the permission dialog. This will add the current logon
use the lauch and access right.

You may have a try and let me know if this does the job for you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Reply-To: "Ian" <[email protected]>
From: "Ian" <[email protected]>
References: <[email protected]>
 
Back
Top