【问题标题】:Using WPF class in a web application, problem with hosting permission在 Web 应用程序中使用 WPF 类,托管权限问题
【发布时间】:2011-02-06 18:36:26
【问题描述】:

我正在开发一个使用 WPF 类进行图像处理的 DLL。 它在我的本地环境中运行良好,但是当我尝试在托管网站中使用它时,我检索到此错误:

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

当我尝试调用 BitmapImage 对象的 EndInit() 时:

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

有什么建议吗?

【问题讨论】:

  • 你用的是什么主机? 1和1?

标签: c# wpf web permissions shared-hosting


【解决方案1】:

请您的主机更改权限。

如果他们拒绝,请切换到更好的虚拟主机。

【讨论】:

  • 不,我的虚拟主机说在共享主机中没有办法让 dll 完全信任。如果您知道可以执行此操作的共享托管服务,请告诉我!谢谢!
  • 我正在使用 LFC 共享主机,这是完全信任的。
  • 我正在使用 Aruba,但现在我想看看这个 LFC,谢谢你的回答
猜你喜欢
  • 2021-12-26
  • 2012-03-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多