开发者

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

开发者 https://www.devze.com 2022-12-26 04:39 出处:网络
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:

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.C开发者_运维问答acheOption = BitmapCacheOption.OnLoad;
originalImage.UriSource = new Uri(physical_imagepath);
originalImage.EndInit();

Any suggestion?


Ask your host to change the permissions.

If they refuse, switch to a better webhost.

0

精彩评论

暂无评论...
验证码 换一张
取 消