Using WPF class in a web application, problem with hosting permission

Posted by tanathos on Stack Overflow See other posts from Stack Overflow or by tanathos
Published on 2010-04-11T18:43:43Z Indexed on 2010/04/11 18:53 UTC
Read the original article Hit count: 215

Filed under:
|
|
|
|

I'm developing a DLL that uses WPF classes to make image manipulation. It works fine in my local environment, but when I try to use it in an hosted web site I retrieve this error:

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

exactly when I try to call the EndInit() of a BitmapImage object:

BitmapImage originalImage = new BitmapImage();
originalImage.BeginInit();
originalImage.CacheOption = BitmapCacheOption.OnLoad;
originalImage.UriSource = new Uri(physical_imagepath);
originalImage.EndInit();

Any suggestion?

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf