ReportViewer10.0 Windows驗證模式下 An error occurred during local report processing.Failed to load expres

來源:互聯網
上載者:User
文章目錄
  • LocalReport.SetBasePermissionsForSandboxAppDomain 方法
An error occurred during local report processing.Failed to load expression host assembly. Details: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e0

解決方案,為ReportViewer的LocalReport設定許可權:

var reportInstance = new LocalReport();reportInstance.SetBasePermissionsForSandboxAppDomain(new PermissionSet(PermissionState.Unrestricted));

I don't really understand why. I do understand that the report is being granted permissions it can't get from WIF, but I don't understand which permissions those are or why it needs them. So, my answer "gives a man a fish," but can someone else "teach a man to fish" by explaining the deeper issue?

LocalReport.SetBasePermissionsForSandboxAppDomain 方法

為Vs2010新添加的方法。使用提供的許可權集設定沙箱應用程式域的基本許可權。

沙箱應用程式域中的基本許可權應用於自訂代碼程式集和報表運算式的計算。請注意,此方法將所有現有基本許可權集替換為提供的許可權集。您應當確保提供的許可權集包括 Execution許可權。否則,將無法執行任何自訂代碼程式集,且無法計算任何錶達式。

如果您更改了許可權,請確保不能使用 LocalReport 對象訪問任何不可信的報表定義。在 .NET Framework 3.5(或啟用了 LegacySecurityPolicy 的 .NET Framework 4 中),必須顯式調用 ExecuteReportInSandboxAppDomain 方法才能切換到沙箱應用程式域模式。

http://msdn.microsoft.com/zh-cn/library/microsoft.reporting.webforms.localreport.aspx

http://stackoverflow.com/questions/4794968/reporting-services-localreport-and-wif

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.