Connecting Tech Pros Worldwide Help | Site Map

Access Denied trying to create New Instantance of Object

Ian
Guest
 
Posts: n/a
#1: Jul 21 '05
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


Peter Huang [MSFT]
Guest
 
Posts: n/a
#2: Jul 21 '05

re: Access Denied trying to create New Instantance of Object


Hi Lan,

It seems that you want to make a Serviced Component.
Here is a example.
Serviced Component Example
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconservicedcomponentexample.asp

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.

--------------------[color=blue]
>Reply-To: "Ian" <idalton@dlbabson.com>
>From: "Ian" <idalton@dlbabson.com>
>Subject: Access Denied trying to create New Instantance of Object
>Date: Thu, 25 Sep 2003 10:17:54 -0400
>Lines: 34
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>Message-ID: <exVHY$2gDHA.520@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.general
>NNTP-Posting-Host: bh2.massmutual.com 63.66.112.5
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109860
>X-Tomcat-NG: microsoft.public.dotnet.general
>
>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[/color]
object[color=blue]
>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+.[/color]
So[color=blue]
>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
>
>
>[/color]

Ian
Guest
 
Posts: n/a
#3: Jul 21 '05

re: Access Denied trying to create New Instantance of Object


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



"Peter Huang [MSFT]" <v-phuang@online.microsoft.com> wrote in message
news:Ydkpmy#gDHA.2624@cpmsftngxa06.phx.gbl...[color=blue]
> Hi Lan,
>
> It seems that you want to make a Serviced Component.
> Here is a example.
> Serviced Component Example
>[/color]
http://msdn.microsoft.com/library/de...us/cpguide/htm[color=blue]
> l/cpconservicedcomponentexample.asp
>
> 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.
>
> --------------------[color=green]
> >Reply-To: "Ian" <idalton@dlbabson.com>
> >From: "Ian" <idalton@dlbabson.com>
> >Subject: Access Denied trying to create New Instantance of Object
> >Date: Thu, 25 Sep 2003 10:17:54 -0400
> >Lines: 34
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
> >Message-ID: <exVHY$2gDHA.520@tk2msftngp13.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.general
> >NNTP-Posting-Host: bh2.massmutual.com 63.66.112.5
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109860
> >X-Tomcat-NG: microsoft.public.dotnet.general
> >
> >The beginning of my assembly that I am getting the access error from[/color][/color]
looks[color=blue][color=green]
> >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[/color]
> object[color=green]
> >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+.[/color]
> So[color=green]
> >I don't where the disconnect is for me. I know it has something to do[/color][/color]
with[color=blue][color=green]
> >EnterpriseServices but I just don't what?
> >
> >Any help would be helpful
> >
> >
> >[/color]
>[/color]


Peter Huang [MSFT]
Guest
 
Posts: n/a
#4: Jul 21 '05

re: Access Denied trying to create New Instantance of Object


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.

--------------------[color=blue]
>Reply-To: "Ian" <idalton@dlbabson.com>
>From: "Ian" <idalton@dlbabson.com>
>References: <exVHY$2gDHA.520@tk2msftngp13.phx.gbl>[/color]
<Ydkpmy#gDHA.2624@cpmsftngxa06.phx.gbl>[color=blue]
>Subject: Re: Access Denied trying to create New Instantance of Object
>Date: Fri, 26 Sep 2003 07:57:30 -0400
>Lines: 94
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>Message-ID: <eBzpCWChDHA.2456@TK2MSFTNGP12.phx.gbl>
>Newsgroups: microsoft.public.dotnet.general
>NNTP-Posting-Host: bh2.massmutual.com 63.66.112.5
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:110006
>X-Tomcat-NG: microsoft.public.dotnet.general
>
>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
>
>
>
>"Peter Huang [MSFT]" <v-phuang@online.microsoft.com> wrote in message
>news:Ydkpmy#gDHA.2624@cpmsftngxa06.phx.gbl...[color=green]
>> Hi Lan,
>>
>> It seems that you want to make a Serviced Component.
>> Here is a example.
>> Serviced Component Example
>>[/color]
>http://msdn.microsoft.com/library/de...-us/cpguide/ht[/color]
m[color=blue][color=green]
>> l/cpconservicedcomponentexample.asp
>>
>> 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[/color][/color]
rights.[color=blue][color=green]
>>
>> --------------------[color=darkred]
>> >Reply-To: "Ian" <idalton@dlbabson.com>
>> >From: "Ian" <idalton@dlbabson.com>
>> >Subject: Access Denied trying to create New Instantance of Object
>> >Date: Thu, 25 Sep 2003 10:17:54 -0400
>> >Lines: 34
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>> >Message-ID: <exVHY$2gDHA.520@tk2msftngp13.phx.gbl>
>> >Newsgroups: microsoft.public.dotnet.general
>> >NNTP-Posting-Host: bh2.massmutual.com 63.66.112.5
>> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
>> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109860
>> >X-Tomcat-NG: microsoft.public.dotnet.general
>> >
>> >The beginning of my assembly that I am getting the access error from[/color][/color]
>looks[color=green][color=darkred]
>> >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[/color]
>> object[color=darkred]
>> >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[/color][/color][/color]
com+.[color=blue][color=green]
>> So[color=darkred]
>> >I don't where the disconnect is for me. I know it has something to do[/color][/color]
>with[color=green][color=darkred]
>> >EnterpriseServices but I just don't what?
>> >
>> >Any help would be helpful
>> >
>> >
>> >[/color]
>>[/color]
>
>
>[/color]

Closed Thread


Similar .NET Framework bytes