[英]Using WPF class in a web application, problem with hosting permission
I'm developing a DLL that uses WPF classes to make image manipulation. 我正在开发一个使用WPF类进行图像处理的DLL。 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对象的EndInit()时:
BitmapImage originalImage = new BitmapImage();
originalImage.BeginInit();
originalImage.CacheOption = 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. 如果他们拒绝,请切换到更好的虚拟主机。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.