Groups | Blog | Home
all groups > sql server reporting services > june 2006 >

sql server reporting services : File System Access With Custom Assembly Method


jeffjones176 NO[at]SPAM gmail.com
6/22/2006 1:01:45 PM
Hello All,

I am building a dashboard report that will read through the file system
for a record's document folder on our server and report to the user if
there are any files missing in the directory. I am using a custom
assembly to house the method. When using the assembly in the dev
environment, everything works just fine. When the report is deployed
to the server, the assembly seems to work fine, but on closer
inspection, it looks like I cannot read the file system. Can someone
point me to a link that can bypass this (safely)? Do I need to suck it
up and create an ASP.NET app that does the same thing?

Thanks
Jeff
Maran
6/26/2006 12:29:01 AM
Hi Jeff.

You need to change the "rssrvpolicy.config" to permit file access to your
assembly. In Visual Studio you have all permissions, but running on the
report server permission checks is performed.

In "rssrvpolicy.config" you can see several codegroups giving other
assemblies certain permissions. The file is found in "%SQL
SERVER%\MSSQL\Reporting Services\ReportServer"

You can put you CodeGroup below the one ending with Url="$CodeGen$/*". Se
sample:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCodeGroup"
Description="Code group for my assembly">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyAssembly.MyNamespace.MyClass.dll"
/>
</CodeGroup>

This way you give you assemmbly Full thrust. To limit persmission to file
access you can change PermissionSet to "FileIOPermission".

Kind regards
Martin Bring (Sogeti AB)

*****************

[quoted text, click to view]
AddThis Social Bookmark Button