fkmfkm
asked on
COM+ Application Libary/Server Activation
I have created a serviced component using VB.NET. I have set the Actication type to Library and create a test application using normal exe. It works..
But when I call it from ASP.NET it fails with the following error :=
Server Error in '/WebApplication1' 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.UnauthorizedAccessE xception: 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.
Source Error:
Line 25: Dim a As ClassLibrary1.Poolable
Line 26:
Line 27: a = New ClassLibrary1.Poolable()
Line 28: End Sub
Line 29: End Class
Source File: c:\inetpub\wwwroot\WebAppl ication1\W ebForm1.as px.vb Line: 27
Stack Trace:
[UnauthorizedAccessExcepti on: Access is denied.]
System.Runtime.InteropServ ices.Marsh al.ThrowEx ceptionFor HR(Int32 errorCode, IntPtr errorInfo) +0
System.EnterpriseServices. Thunk.Prox y.CoCreate Object(Typ e serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri) +587
System.EnterpriseServices. ServicedCo mponentPro xyAttribut e.CreateIn stance(Typ e serverType) +181
System.Runtime.Remoting.Ac tivation.A ctivationS ervices.Cr eateInstan ceWithLink Demand(Pro xyAttribut e pa, Type serverType) +4
System.Runtime.Remoting.Ac tivation.A ctivationS ervices.Is CurrentCon textOK(Typ e serverType, Object[] props) +122
WebApplication1.WebForm1.B utton1_Cli ck(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebAppl ication1\W ebForm1.as px.vb:27
System.Web.UI.WebControls. Button.OnC lick(Event Args e) +108
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +57
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +33
System.Web.UI.Page.Process RequestMai n() +1263
I tried changing the Activation to Server and the page works. Why is this happening ? How can I make it work again ? thank you very much..
Need your help..
But when I call it from ASP.NET it fails with the following error :=
Server Error in '/WebApplication1' 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.UnauthorizedAccessE
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.
Source Error:
Line 25: Dim a As ClassLibrary1.Poolable
Line 26:
Line 27: a = New ClassLibrary1.Poolable()
Line 28: End Sub
Line 29: End Class
Source File: c:\inetpub\wwwroot\WebAppl
Stack Trace:
[UnauthorizedAccessExcepti
System.Runtime.InteropServ
System.EnterpriseServices.
System.EnterpriseServices.
System.Runtime.Remoting.Ac
System.Runtime.Remoting.Ac
WebApplication1.WebForm1.B
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
I tried changing the Activation to Server and the page works. Why is this happening ? How can I make it work again ? thank you very much..
Need your help..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
u can change the machine.config file
and changin 'machine' to 'SYSTEM'
and it will work
and changin 'machine' to 'SYSTEM'
and it will work
ASKER
How should i give the points to GoodJun and yosit ?
Did you solved your problem? If not, we can guide you through to make it work.
cheers,
cheers,
ASKER
How if I am doing normal ASP 3.0 pages ?
asp 3.0 also support impersonation.
Thanks for the grade.
Thanks for the grade.
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.
When you run the component from a windows application it is running under the user id of the person log on the machine. That person (you) has the rights to run such an application. When you run an asp page the process must run under a user id, but since any user migth be accesing the page the user asigned to the page has limited authority. What you have to do is to assign the proper authority to the dll. Unfortunately, I have not yet reach that chapter on my book.