My contemplations and diurnal novelties are publicized here


There do exist several issues with trust level when using any dll for pdf creation. I first tried microsoft reporting but it requires full trust. Then I opted for itextSharp but again I run into a problem of full trust. This article

http://instantdevelopment.blogspot.com/2009/10/itextsharp-pdf-rendering-in-medium.html really help me out to find a way to make the assembly work under medium trust.

 

Also You can check the current trust level using this code snipped.

 

AspNetHostingPermissionLevel GetCurrentTrustLevel()

    {

        foreach (AspNetHostingPermissionLevel trustLevel in

        new AspNetHostingPermissionLevel[] {

AspNetHostingPermissionLevel.Unrestricted,

AspNetHostingPermissionLevel.High,

AspNetHostingPermissionLevel.Medium,

AspNetHostingPermissionLevel.Low,

AspNetHostingPermissionLevel.Minimal

})

        {

            try

            {

                new AspNetHostingPermission(trustLevel).Demand();

            }

            catch (System.Security.SecurityException)

            {

                continue;

            }

            return trustLevel;

        }

        return AspNetHostingPermissionLevel.None;

    }

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: