Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
An error occurred during local report processing.
The definition of the report 'E:\Markfed\Link_Report\OpeningStockReport.rdlc' is invalid.
An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC2012] can't open 'C:\Windows\TEMP\expression_host_9c0eaa032bb64a25be60c4cccf4464f2.dll' for writing’.

i have added all below dll

Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll

error occurred on server.in local project work fine

What I have tried:

In local project work fine no error show but on server error occurred
Posted
Updated 13-Jun-18 1:44am

1 solution

The process has no write access to the folder C:\Windows\TEMP which is expected because that is a system folder requiring administrative privileges for reading and writing.

That it works in your local project indicates that you are running it there as Administrator (or - even worse - has changed the access rights of the folder).

You should check where in your code that folder is defined as temporary folder instead of using one of the temporary folders of the user running the application.
 
Share this answer
 
Comments
ankitchourasia07 13-Jun-18 8:05am    
but why it show error in .rdlc reporting tool .its work fine in .aspx page on server in same folder.. and how to give permission after deploy
Jochen Arndt 13-Jun-18 8:19am    
I don't know why it works on some systems. But I have explained why it does not work on other systems. The solution is not to give all systems access to the folder but to do it right by not using that folder.

Find out where it is defined in your code / settings and replace it with one of the common temporary folders.

Or does the error occur during some kind of setup? Then the setup must be executed as Administrator.

The folder "%WINDIR%\TEMP" is for usage by the system only with recent Windows version. It has been used by Windows 2/3 and 9x as temp folder but should not be used anymore by applications since (AFAIK) Windows XP.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900