问题
I'm using Microsoft.Reporting.Webforms version 10 in order to parse an RDLC file and produce a PDF. The RDLC is a simple invoice with a couple of embedded expressions.
When I run the application I get an exception that a call to the obsoleted SecurityAction.RequestMinimum has been made when compiling the expressions.
Is this a known bug or something I can remedy?
An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC40000] 'RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'.’.
at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot) at Microsoft.Reporting.PreviewStore.StoredReport.EnsureCompiled(CatalogItemContextBase itemContext) at Microsoft.Reporting.PreviewStore.GetCompiledReport(CatalogItemContextBase context, Boolean rebuild, Byte[]& reportDefinition, ControlSnapshot& snapshot) at Microsoft.Reporting.PreviewStore.GetCompiledReport(CatalogItemContextBase context, Boolean rebuild, ControlSnapshot& snapshot) at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContextBase itemContext, Boolean rebuild, ControlSnapshot& snapshot) at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContextBase itemContext, Boolean rebuild) at Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
回答1:
I also had this issue and by me it turned out that when there is a syntax error in an expression it displayed this error.
回答2:
I had this issue as well when trying to run one of our reports. It turns out that the report did not build properly. Attempting to build it in Visual Studio revealed all of the errors, and after I resolved them the report ran properly. If you get this error, double check to make sure that your report actually builds.
来源:https://stackoverflow.com/questions/8244098/rdlc-making-call-to-obsolete-securityaction-enumeration