代码之家  ›  专栏  ›  技术社区  ›  tanathos

在web应用程序中使用WPF类时,托管权限出现问题

  •  1
  • tanathos  · 技术社区  · 16 年前

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

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

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

    有什么建议吗?

    1 回复  |  直到 16 年前
        1
  •  0
  •   SLaks    16 年前

    要求您的主机更改权限。

    如果他们拒绝,就换一个更好的网络主机。

    推荐文章