Home All Groups Group Topic Archive Search About

COM+ Security error

Author
19 Oct 2006 6:23 PM
Devin
I am trying to access a COM+ component through embedded code of my
Reporting Services
report (an ASP.NET application).  I did everything that Reporting
Services told me to use an external dll, but I am still getting the
following error:

System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at
System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type
serverType)
at
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj)
at ReportExprHostImpl.CustomCodeProxy.GetInvestmentTypeTest(Int32
partyId)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
MyComputer

I am an admin on the machine and I even unchecked "Enforce access
checks for this application" in COM+ for this component, so permissions
really shouldn't be a problem.  I also made the account that reporting
services runs under an admin on the machine and it didn't help.

I tried the same steps but with a dll not in COM+ and it works fine.

I know that COM+ security is different than other dll's on the machine,
but does anyone know why this error would occur if the account being
used is an admin to the machine and security checks are turned off
within COM+?

Thanks,
Devin

Author
28 Oct 2006 12:39 PM
Nicole Calinoiu
This is a CAS (code access security) permission issue, not a user permission
issue, so the fact that you're an admin or the disabling of COM+ access
checks are irrelevant.  Given that you're attempting to access the COM+
application from a Reporting Services app, the most likely cause is that
your application is running at a restricted CAS permission level.  The
missing permission that is causing the problem is
SecurityPermission\UnmanagedCode.  This is only available at the FullTrust
permission level.  Unfortunately, I know next to nothing about Reporting
Services, but the following KB article looks like it's probably detailed
enough to walk you through granting the additional permissions to your
assembly: http://support.microsoft.com/kb/842419.  There are also some
examples of policy file modifications at
http://msdn2.microsoft.com/en-us/library/ms152828.aspx.


Show quoteHide quote
"Devin" <dlo***@granitelp.com> wrote in message
news:1161282197.516500.166050@i42g2000cwa.googlegroups.com...
>I am trying to access a COM+ component through embedded code of my
> Reporting Services
> report (an ASP.NET application).  I did everything that Reporting
> Services told me to use an external dll, but I am still getting the
> following error:
>
> System.Security.SecurityException: Request for the permission of type
> 'System.Security.Permissions.SecurityPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> failed.
> at
> System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type
> serverType)
> at
> System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type
> serverType, Object[] props, Boolean bNewObj)
> at ReportExprHostImpl.CustomCodeProxy.GetInvestmentTypeTest(Int32
> partyId)
> The action that failed was:
> Demand
> The type of the first permission that failed was:
> System.Security.Permissions.SecurityPermission
> The Zone of the assembly that failed was:
> MyComputer
>
> I am an admin on the machine and I even unchecked "Enforce access
> checks for this application" in COM+ for this component, so permissions
> really shouldn't be a problem.  I also made the account that reporting
> services runs under an admin on the machine and it didn't help.
>
> I tried the same steps but with a dll not in COM+ and it works fine.
>
> I know that COM+ security is different than other dll's on the machine,
> but does anyone know why this error would occur if the account being
> used is an admin to the machine and security checks are turned off
> within COM+?
>
> Thanks,
> Devin
>
Author
30 Oct 2006 4:41 PM
Devin
Thanks for the help.  I saw those articles and I did follow them but
they didn't quite work.  I can access an external dll in the GAC or
located on the machine from the report just fine.  Once it goes into
COM+, I can only access the dll in the designer.  Once the report is
deployed, I get that security error.  I'm almost positive it has
something to do with Reporting Services talking to COM+.  It's only
after the dll goes into COM+ that all these problems arise.  Before
that, everything works fine.  I wonder if there are any COM+ assemblies
that I may need to put into those config files to give RS access to
them?  Any more help would be greatly appreciated.

Thanks,
Devin

Nicole Calinoiu wrote:
Show quoteHide quote
> This is a CAS (code access security) permission issue, not a user permission
> issue, so the fact that you're an admin or the disabling of COM+ access
> checks are irrelevant.  Given that you're attempting to access the COM+
> application from a Reporting Services app, the most likely cause is that
> your application is running at a restricted CAS permission level.  The
> missing permission that is causing the problem is
> SecurityPermission\UnmanagedCode.  This is only available at the FullTrust
> permission level.  Unfortunately, I know next to nothing about Reporting
> Services, but the following KB article looks like it's probably detailed
> enough to walk you through granting the additional permissions to your
> assembly: http://support.microsoft.com/kb/842419.  There are also some
> examples of policy file modifications at
> http://msdn2.microsoft.com/en-us/library/ms152828.aspx.
>
>
> "Devin" <dlo***@granitelp.com> wrote in message
> news:1161282197.516500.166050@i42g2000cwa.googlegroups.com...
> >I am trying to access a COM+ component through embedded code of my
> > Reporting Services
> > report (an ASP.NET application).  I did everything that Reporting
> > Services told me to use an external dll, but I am still getting the
> > following error:
> >
> > System.Security.SecurityException: Request for the permission of type
> > 'System.Security.Permissions.SecurityPermission, mscorlib,
> > Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> > failed.
> > at
> > System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type
> > serverType)
> > at
> > System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type
> > serverType, Object[] props, Boolean bNewObj)
> > at ReportExprHostImpl.CustomCodeProxy.GetInvestmentTypeTest(Int32
> > partyId)
> > The action that failed was:
> > Demand
> > The type of the first permission that failed was:
> > System.Security.Permissions.SecurityPermission
> > The Zone of the assembly that failed was:
> > MyComputer
> >
> > I am an admin on the machine and I even unchecked "Enforce access
> > checks for this application" in COM+ for this component, so permissions
> > really shouldn't be a problem.  I also made the account that reporting
> > services runs under an admin on the machine and it didn't help.
> >
> > I tried the same steps but with a dll not in COM+ and it works fine.
> >
> > I know that COM+ security is different than other dll's on the machine,
> > but does anyone know why this error would occur if the account being
> > used is an admin to the machine and security checks are turned off
> > within COM+?
> >
> > Thanks,
> > Devin
> >