Hi All,
Can do with some assistancce with a custom assembly I have ceated for SSRS Reports the assembly works based on the code functionailty, but when I want to write to the event log, so that I can catch any exceptions from the code and write the exception to the event logs I get the following error.
Request for the permission of type 'System.Diagnostics.EventLogPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
I have created the code group for my custom dll (please see below) and have added my custom assebly to the GAC, but every time the line executes to add log entry to the application log I get the above error.
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust">
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Report_Expressions_Default_Permissions"
Description="This code group grants default permissions for code in report expressions and Code element. ">
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust"
Description="This code group grants MyComputer code Execution permission. ">
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Microsoft_Strong_Name"
Description="This code group grants code signed with the Microsoft strong name full trust. ">
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Ecma_Strong_Name"
Description="This code group grants code signed with the ECMA strong name full trust. ">
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Report_Server_Strong_Name"
Description="This code group grants Report Server code full trust. ">
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="SharePoint_Server_Strong_Name"
Description="This code group grants SharePoint Server code full trust. ">
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="XXX.Apps.SSRS"
Description="XXX SSRS Utility Class. ">
</CodeGroup>
</CodeGroup>
</CodeGroup>
I am running SSRS on SQL 2008 R2.
I have also changed the ssrs policy file as you can see above (I condensed the policy file so that I can post this in the article) and I have given full trust to FirstMatchCodeGroup & UnionCodeGroup & FirstMatchCodeGroup too and not having much success.
The line of code failing is;
Any pointers or help would be appreciated.
EventLog.WriteEntry(EventSource, logMessage, et, 0786);
Many Thanks
Bobby H :O)
Bobby Habib SharePoint .Net Technical Lead / Developer