I am creating a DLL that utilizes WPF classes to create image manipulation. It really works fine during my local atmosphere, however when I use it within an located site I retrieve this error:

Request the permission of type 'System.Security.Permissions.MediaPermission, WindowsBase, Version=3..., Culture=neutral, PublicKeyToken=31bf3856ad364e35' unsuccessful.

exactly after i attempt to call the EndInit() of the BitmapImage object:

BitmapImage originalImage = new BitmapImage()


originalImage.CacheOption = BitmapCacheOption.OnLoad

originalImage.UriSource = new Uri(physical_imagepath)


Any suggestion?

Request your host to alter the permissions.

When they refuse, change to a much better webhost.