I had created an application that used the ReportViewer, and of course it worked fine on development. But once published, I too got the error that said "... The file has not been pre-compiled, and cannot be requested." As usual, a not very helpful error message and is confusing.
Issue:
The server I was publishing to did not have the Microsoft.ReportViewer.Webforms.dll in the bin folder (or any Crystal Report dlls). These do not get published over with your application, they are stored and referenced differently.
Solution:
1) one solution is to find the .dll on your development server and manually add it to the bin of your application. This works, but only for that application. And if you have more than one application using Crystal Reports (ReportViewer), then you'd have to manually do this for each application you publish.
2) a more efficient fix is to install the Crystal Web Components (make sure the version is the same you are developing with.. i.e. Crystal Reports 2008..). This file will not install Crystal Reports on your server, only the .dlls needed. The file will look like CR08.Setup or CR11.Setup... so forth. Move that file to the server, install and any application using ReportViewer will work. Without having to manually add the .dll to your apps.
Hope this helps!
Comments
Post a Comment