Multimobile Development: Building Applications for any Smartphone
COM+ with ASP.NET
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.component_services.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Miroslav Havram
GOOD ANSWER
Hi there,

All day I try to resolve one problem, but still without answer...

Here is the prologue:

I wrote COM+ component that need to do some job for me and install it on server machine, then I create application proxy for this component for distribution on clients machines. Installing proxy was without problems. Then I go to test it... Desktop application (writen in c#) that uses that component (via proxy) working OK, everything is working as expect, but when I try to do same thing from ASP.NET, there appear error:

Server Error in '/test_p3' 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.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Why that happens?? Where I need to gain access to ASP.NET process?? Am I need to configure COM+ application on server machine to resolve this or on client (because desktop application working fine, I think that it is on client...)??

P.S. Both machines (client and server) has installed .NET Framework (release), and COM+ Rollup Hotfix 18.1

Thanks,
Miroslav Havram

Reply to this message...
Vote that this is a GOOD answer... (15 votes from other users already)
 
 
    
Willy Denoyette [MVP] (VIP)
GOOD ANSWER
The default ASPNET user has no network credentials, so it can't access the remote component (using DCOM remember) through the proxy.
Now ther are a number of solutions possible:
- Or you change the identity of the asp.net worker process (see your config.web file) into a domain principal.
- Or you impersonate a fixed user (see also your config.web)
- Or you wrap the proxy in a COM+ server application (just delegating the calls to the proxy) and run this COM+ server application as a domain principal.
For security reasons the last option is the prefered one, the first gives all asp.net applications access to non local resources.

Willy.

"Miroslav Havram" <Click here to reveal e-mail address> wrote in message news:OteYlRzMCHA.2368@tkmsftngp10...
Hi there,

All day I try to resolve one problem, but still without answer...

Here is the prologue:

I wrote COM+ component that need to do some job for me and install it on server machine, then I create application proxy for this component for distribution on clients machines. Installing proxy was without problems. Then I go to test it... Desktop application (writen in c#) that uses that component (via proxy) working OK, everything is working as expect, but when I try to do same thing from ASP.NET, there appear error:

Server Error in '/test_p3' 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.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Why that happens?? Where I need to gain access to ASP.NET process?? Am I need to configure COM+ application on server machine to resolve this or on client (because desktop application working fine, I think that it is on client...)??

P.S. Both machines (client and server) has installed .NET Framework (release), and COM+ Rollup Hotfix 18.1

Thanks,
Miroslav Havram

Reply to this message...
Vote that this is a GOOD answer... (20 votes from other users already)
 
 
    
Miroslav Havram
GOOD ANSWER
Hi,

What is the way to do third thing (wrap the proxy delegating the calls to the proxy)?

Thanks,
Miroslav Havram

Reply to this message...
Vote that this is a GOOD answer... (18 votes from other users already)
 
 
    
binary digit
GOOD ANSWER
Use the regsvcs tool to register the com+ component on the asp.net web
server. I had the same problem and this solved it. Lemme know if it helps.

Reply to this message...
Vote that this is a GOOD answer... (19 votes from other users already)
 
 
    
vinay balasubramaniam
GOOD ANSWER
Hi

I am facing a similar problem ...

but in my case i am getting the same exception in console application ....

i managed to export the proxy for a serviced COM+ component written in c# and i was able

to deploy it on client...when i deploy it on client it generates a same package with

the remoted machine info and it generates the tlb file too

now when i try to create a client application(c#) to access this serviced component it throws an exception

do u have any idea how i can get the type information on the client to be able to call the servied component through the

proxy??? if i try to add reference to the tlb file it throws an error "that it cannot add reference

to the file... "

how did u go about calling the methods in serviced component from client ....

in case you have code sinppets it will be useful...

its really urgent as its a project requirement for me

Eagerly awating for your reply

Vinay

"Willy Denoyette [MVP]" <Click here to reveal e-mail address> wrote in message news:e2N$DV1MCHA.2236@tkmsftngp04...
The default ASPNET user has no network credentials, so it can't access the remote component (using DCOM remember) through the proxy.
Now ther are a number of solutions possible:
- Or you change the identity of the asp.net worker process (see your config.web file) into a domain principal.
- Or you impersonate a fixed user (see also your config.web)
- Or you wrap the proxy in a COM+ server application (just delegating the calls to the proxy) and run this COM+ server application as a domain principal.
For security reasons the last option is the prefered one, the first gives all asp.net applications access to non local resources.

Willy.

"Miroslav Havram" <Click here to reveal e-mail address> wrote in message news:OteYlRzMCHA.2368@tkmsftngp10...
Hi there,

All day I try to resolve one problem, but still without answer...

Here is the prologue:

I wrote COM+ component that need to do some job for me and install it on server machine, then I create application proxy for this component for distribution on clients machines. Installing proxy was without problems. Then I go to test it... Desktop application (writen in c#) that uses that component (via proxy) working OK, everything is working as expect, but when I try to do same thing from ASP.NET, there appear error:

Server Error in '/test_p3' 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.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Why that happens?? Where I need to gain access to ASP.NET process?? Am I need to configure COM+ application on server machine to resolve this or on client (because desktop application working fine, I think that it is on client...)??

P.S. Both machines (client and server) has installed .NET Framework (release), and COM+ Rollup Hotfix 18.1

Thanks,
Miroslav Havram

Reply to this message...
Vote that this is a GOOD answer... (168 votes from other users already)
 
 
 
System.UnauthorizedAccessException




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734