Friday, February 17, 2012

Custom Assembly Configuration Problems

Hi,
I am attempting to integrate a third party .Net assembly into a custom
report I'm writing. The assembly provides functions for creating 2D barcodes
that are a required format for my solution. I've successfully referenced the
assembly and can run my report from visual studio without error.
However, when I deploy and run the report I get the following exception:
Failed to load expression host assembly. Details:
System.Security.Permissions.SecurityPermission (rsProcessingError)
I've added the Custom Assemblies block to my RSReportDesigner.config and my
RSReportServer.config. I have also added code groups to my
rssrvpolicy.config and rspreviewpolicy.config. I have deployed the
referenced dlls to the appropriate bin directories.
The only thing that I haven't done is code the custom assembly to 'assert
permissions'. I shouldn't have to because the assembly takes a simple string
and returns the encoded string - it doesn't use any 'secure' resources (no
files, db connections, etc.). I have also tried using 'FullTrust'
permissions in my code groups even though that is not recommended. In any
event, I do not have source code for this third party assembly nor license to
modify it if I could.
Is there anything I can do to make this work?
--
PaulThe problem is that the third party assembly has strong name and is not
marked with APTCA
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/aptcatypes.asp)
The report expressions at runtime are located in an untrusted assembly thus
any call to a non_APTCA assembly would fail. What you need to do is to
create a thin wrapper assembly that would accept calls from report
expressions and redirect them into the non-APTCA assembly. You will also
need to give fulltrust to that wrapper assembly
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paul Keegstra" <PaulKeegstra@.discussions.microsoft.com> wrote in message
news:2F8F0E0C-9C98-4EBD-B9D5-AF6D667975BB@.microsoft.com...
> Hi,
> I am attempting to integrate a third party .Net assembly into a custom
> report I'm writing. The assembly provides functions for creating 2D
> barcodes
> that are a required format for my solution. I've successfully referenced
> the
> assembly and can run my report from visual studio without error.
> However, when I deploy and run the report I get the following exception:
> Failed to load expression host assembly. Details:
> System.Security.Permissions.SecurityPermission (rsProcessingError)
> I've added the Custom Assemblies block to my RSReportDesigner.config and
> my
> RSReportServer.config. I have also added code groups to my
> rssrvpolicy.config and rspreviewpolicy.config. I have deployed the
> referenced dlls to the appropriate bin directories.
> The only thing that I haven't done is code the custom assembly to 'assert
> permissions'. I shouldn't have to because the assembly takes a simple
> string
> and returns the encoded string - it doesn't use any 'secure' resources (no
> files, db connections, etc.). I have also tried using 'FullTrust'
> permissions in my code groups even though that is not recommended. In any
> event, I do not have source code for this third party assembly nor license
> to
> modify it if I could.
> Is there anything I can do to make this work?
> --
> Paul|||That doesn't work. Actually, it makes it worse because whereas before I had
a clearly identified exception, adding the wrapper class only results in my
expression evaluating to #Error - with no clue as to the cause. My guess is
it's just the same error, only now the exception has been wrapped out of view.
--
Paul
"Alexandre Mineev MSFT" wrote:
> The problem is that the third party assembly has strong name and is not
> marked with APTCA
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/aptcatypes.asp)
> The report expressions at runtime are located in an untrusted assembly thus
> any call to a non_APTCA assembly would fail. What you need to do is to
> create a thin wrapper assembly that would accept calls from report
> expressions and redirect them into the non-APTCA assembly. You will also
> need to give fulltrust to that wrapper assembly
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Paul Keegstra" <PaulKeegstra@.discussions.microsoft.com> wrote in message
> news:2F8F0E0C-9C98-4EBD-B9D5-AF6D667975BB@.microsoft.com...
> > Hi,
> >
> > I am attempting to integrate a third party .Net assembly into a custom
> > report I'm writing. The assembly provides functions for creating 2D
> > barcodes
> > that are a required format for my solution. I've successfully referenced
> > the
> > assembly and can run my report from visual studio without error.
> >
> > However, when I deploy and run the report I get the following exception:
> > Failed to load expression host assembly. Details:
> > System.Security.Permissions.SecurityPermission (rsProcessingError)
> >
> > I've added the Custom Assemblies block to my RSReportDesigner.config and
> > my
> > RSReportServer.config. I have also added code groups to my
> > rssrvpolicy.config and rspreviewpolicy.config. I have deployed the
> > referenced dlls to the appropriate bin directories.
> >
> > The only thing that I haven't done is code the custom assembly to 'assert
> > permissions'. I shouldn't have to because the assembly takes a simple
> > string
> > and returns the encoded string - it doesn't use any 'secure' resources (no
> > files, db connections, etc.). I have also tried using 'FullTrust'
> > permissions in my code groups even though that is not recommended. In any
> > event, I do not have source code for this third party assembly nor license
> > to
> > modify it if I could.
> >
> > Is there anything I can do to make this work?
> >
> > --
> > Paul
>
>

No comments:

Post a Comment