ReportViewer control access denied to temp folder when hosted in c++
Trying to show a report on a ReportViewer control isn't working in c++ using CWinFormsDialog. The same settings work fine in pure .Net It's VS2010, .Net 4, Windows 7 with SQL Server and reporting services on the same pc. It's a c++ project with /clr The error message seems obvious: Unable to generate a temporary class (result=1). error CS0016: Could not write to output file 'c:\Users\<user>\AppData\Local\Temp\flndbm4.dll' -- 'Access is denied' However, giving Everyone access to the temp folder doesn't make a difference. Can anyone offer any help and hazard a guess as to why there's a difference running it in c++/cli? GetControl()->ProcessingMode = Microsoft::Reporting::WinForms::ProcessingMode::Remote; GetControl()->ServerReport->ReportServerUrl = gcnew Uri("http://localhost/reportserver"); GetControl()->ServerReport->ReportPath ="/AdventureWorks 2008R2/Employee_Sales_Summary_2008r2"; GetControl()->RefreshReport();
March 16th, 2012 9:41am

I believe this is a Microsoft bug: http://connect.microsoft.com/VisualStudio/feedback/details/370582/temp-file-collision-when-building-with-csc-exe A process monitor trace shows the same temp file name trying to be created again by csc.exe. When I turned off indexing in more or my folders under c:\users\<user> the problem goes away. My take on it is that when hosted under C++ the temp file name reserving is not foolproof and doesnt guarantee no clashes. In my mind this is a bit worrying but apparently this is "by design" so thats ok then How many days lost now because Microsoft covers things up? It must be as least 50.
Free Windows Admin Tool Kit Click here and download it now
March 19th, 2012 5:24am

Update: it just doesn't seem to work when running on the machine with reporting services. Running it on a virtual PC connecting to the original reporting services doesn't get the problem. It therefore seeems more than just turning off the indexing. The other thing is that it fails every time. Running applications on the SQL Server machine may be an unlikely scenario in a live environment, but is what you want to do for development and demoing.
March 20th, 2012 9:16am

ReportViewer needs "read,write" access to C:\Windows\Temp folder. The users who access the app on the server, (without VS2010), will need "read,write" permissions. In the case of an ASP.NET application, IIS_USERS would require "read,write" permissions to C:\Windows\Temp folder. There must be a way to set folder permissions programatically.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2012 3:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics