Groups | Blog | Home
all groups > sql server reporting services > august 2004 >

sql server reporting services : Custom Assembly Problems: System.Drawing


derek NO[at]SPAM brokerbuilders.com
8/16/2004 3:09:35 PM
Hi,

I built a Custom Assembly to allow me to use external image files in
my report. I deployed the DLL and configured the security policy
config files.
Everything worked great, i got the image coming through to my report
in both Designer Preview mode and when deployed.

I decided to extend the custom assembly to return the dimensions of
the image as well by adding some code that utilizes System.Drawing.DLL

//ok now, lets get the width and height
//FileIOPermission permission = new FileIOPermission
Image myImage = Image.FromFile(pPath);
g_lastHeight = myImage.Height;
g_lastWidth = myImage.Width;
myImage.Dispose();
myImage=null;

After rebuilding and deploying the DLL, my report no longer has any
images when deployed.
However, the images do show up in Designer preview mode, and the DLL
performs correctly returning the image dimensions upon request,
implying a security policy issue????

So my question is what security policy type things do i need to do in
order to utilize System.Drawing.dll in my DLL.

Any help would be greatly appreciated.

Thanks
Donovan R. Smith [MSFT]
8/16/2004 4:40:16 PM
I believe the correct permission is UIPermission. Please see the following for why it only works in
preview and how to configure the server:

http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/dngrfCodeAccessSecurityInSQLServer2000ReportingServices.asp?frame=true


--
Thanks.

Donovan R. Smith
Software Test Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

AddThis Social Bookmark Button