问题
In my ASP.NET MVC application I sometimes get these errors when I try to open or generate LocalReport from Microsoft Reporting Services assembly:
Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'C:\Inetpub\wwwroot\orders\Reports\Reports\Pending Renewals.rdlc' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.UnauthorizedAccessException: Access to the path 'C:\WINDOWS\TEMP\expression_host_b5ec9f67a3ab42cfb53a75588aed6f75.dll' is denied.
or
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.UnauthorizedAccessException: Access to the path 'C:\WINDOWS\TEMP\expression_host_a1670a6e6b96411790645cb12e50897d.dll' is denied.
What can be the reason? Most of the time it works so it's not security issue. How do I fix it?
Here's what I've found but I'd not like to use "use fields instead of report parameters" solution.
回答1:
I have also faced the same problem. But, when i start my visual studio by "Run As Administrator" Option, the problem wasn't arise anymore.

Hope, this can help you
来源:https://stackoverflow.com/questions/3131529/occasional-access-denied-to-c-windows-temp-files