Asked by:
Accessing COM+ components

Question
-
User-27833865 posted
Hi, I have an application that makes use of a COM+ component. Ihave registered the component. I also have impersonated a user in the web.congif file and set impersonation=true. My application works fine, until the point where it needs to acces the COM+ component. At this time i get the following error: [UnauthorizedAccessException: Access is denied.] System.Runtime.InteropServices.Marshal.BindMoniker(UCOMIMoniker pmk, UInt32 grfOpt, Guid& iidResult, Object& ppvResult) +0 System.Runtime.InteropServices.Marshal.BindToMoniker(String monikerName) +109 StoryLife.CheckoutSummary.btnPurchase_Click(Object sender, ImageClickEventArgs e) +930 When i turn user impersonation =false, it all works just fine. Does anyone have an idea as to why this might be happening? Thanks, NeetThursday, November 6, 2003 6:17 PM
All replies
-
User-599719271 posted
are you impersonating a user which has access to the object?Thursday, November 6, 2003 10:58 PM -
User-884863437 posted
Hi, By default, the Aspnet_wp.exe process runs under a computer account named ASPNET. However, this account does not have the required privileges to impersonate a specific user. You receive an error message if you try to impersonate a specific user. To work around this problem, use one of the following methods: 1)Grant the "Act as part of the operating system" privilege to the ASPNET account (the least privileged account). Procedure ------------- i)go to control panel ii)administrative tools->local security policy iii)In the tree select Security settings->local policies ->user rights assignments iv)Check for "Act as pasrt of operating system" in the pane that appears in the right. v)right click and select security menu and add user aspnet (or) 2) Change the account that the Aspnet_wp.exe process runs under to the System account in the <processModel> configuration section of the Machine.config file. Hope this solves ur problem Good Day SArunFriday, November 7, 2003 2:19 AM -
User-27833865 posted
Hi, THe application works fine as long as i am running it under the ASPNET account. But if i impersonate the ASPNET user to TestUser and grant him the same access rights, it throws the above exception for TestUser. But if i set impersonation=false then it works fine. Since i am using IIS6.0 i cant make use of the Machine.config file as i am running the application in a IIS6.0 mode. But would setting the TestUser to Act as part of operating system help? Thanks, neetFriday, November 7, 2003 11:16 AM -
User-545000943 posted
How are you granting you user the same rights? Are you using COM+ roles and adding your account to the same role as ASPNET (or Network Service)? In Windows Server 2003 by default ASP.Net runs under the Network Service identity (configurable through the application pools identity in the IIS MMC snapin) so you would need to give your account the same access level as Network Service, not ASPNET in W2k3. hope this helpsFriday, November 7, 2003 8:20 PM -
User-27833865 posted
Hi, I am not sure how to set the COM+ roles. Could you please give me an idea? Thanks, NeetSunday, November 9, 2003 1:52 PM -
User-884863437 posted
Hi, Try setting the impersonated user "to run as part of the operating system". since microsoft itself has suggested the changes, i have mentioned in my previous post. Good Day, Arun.Sunday, November 9, 2003 11:39 PM -
User-27833865 posted
Hi, I tried setting the impersonated user to run as part of the operating system, but that didnt help. I am still getting the same error. Any other way i can overcome this issue? Thanks, NeetMonday, November 10, 2003 6:35 PM -
User-27833865 posted
Hi, Setting my impersonated user, TestUser, as part of the Com+ roles also caused the same error. Is there some other settings i need to take care of? Thanks, NeetTuesday, November 11, 2003 4:26 PM