That assembly does not allow partially trusted callers

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="font-size:small <span style="font-size:small
<span style="font-family:Verdana,sans-serif; font-size:9pt Hi
<span style="font-family:Verdana,sans-serif; font-size:9pt I created a class library and added it as an assembly in SSAS. I am trying to call the file using MDX query. It worked normally but when I added a different MDX query to the C# file by adding
a reference to ADOMD client, I get the error " That assembly does not allow partially trusted callers". The same code works when I execute it in console application but when I put it in class library and try to call it from MDX query it doesn’t work. CLR integration
is enabled in SQL Server Configuration Tools. Also I have added following to the code but doesn’t work.

<p style="margin-bottom:0pt <span style="font-family:Consolas; color:green; font-size:9.5pt [System.Security.Permissions.<span style="font-family:Consolas; color:#2b91af; font-size:9.5pt PermissionSet<span style="font-family:Consolas; color:green; font-size:9.5pt (System.Security.Permissions.<span style="font-family:Consolas; color:#2b91af; font-size:9.5pt SecurityAction<span style="font-family:Consolas; color:green; font-size:9.5pt .Demand,
Name = <span style="font-family:Consolas; color:#a31515; font-size:9.5pt FullTrust"<span style="font-family:Consolas; color:green; font-size:9.5pt )]
<p style="margin-bottom:0pt <span style="font-family:Consolas; color:green; font-size:9.5pt <span> [System.Security.Permissions.<span style="font-family:Consolas; color:#2b91af; font-size:9.5pt PermissionSet<span style="font-family:Consolas; color:green; font-size:9.5pt (System.Security.Permissions.<span style="font-family:Consolas; color:#2b91af; font-size:9.5pt SecurityAction<span style="font-family:Consolas; color:green; font-size:9.5pt .Assert,
Unrestricted = <span style="font-family:Consolas; color:blue; font-size:9.5pt true<span style="font-family:Consolas; color:green; font-size:9.5pt )]
<p style="margin-bottom:0pt
<p style="line-height:normal; margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt Also in the AssemblyInfo.cs file I added [<span style="color:blue assembly:
<span style="color:#2b91af AllowPartiallyTrustedCallers]
<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt <span>
<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt I still keep getting the same error not sure as to what am I missing. Everything worked till I added

<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt Using Microsoft.AnalysisServices.AdomdClient

<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt And I need this to execute MDX query in C#
<p style="margin-bottom:0pt
<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt Any suggestion would be of great help.
<p style="margin-bottom:0pt
<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt Thanks
<p style="margin-bottom:0pt <span style="font-family:Consolas; font-size:9.5pt Madhavi
<span>

<a> <hr class="sig Madhavi Pasapula

View the full article
 
Back
Top