Crystal Reports, upgraded to .net 4, deployed app error - Unknown Query Engine Error

driftwood

New member
Joined
Sep 30, 2009
Messages
4
Programming Experience
3-5
Our soultion has been in development since 2005 and has been partnered with Crystal Reports all the way through.

After upgrading all our projects to .net 4 we got a runtime error whenever trying to load a Crystal Report 'Unknown Query Engine Error Error in File C:\DOCUME~1...........'

The following link got us to add a line to the app.config file, and this solved the error while debugging in Visual Studio:
Blogs - Crystal Reports error after upgrading to .NET Framework 4.0

However when I deploy the application we are still getting the error on client machines. We don't use click once, we have our own app on client machines that basically downloads the latest files to a location in their program files directory. Files such as signed dlls and the exe, and the crystal report (.rpt) files. In addition to the various project dlls, the main project output is an .exe file. This is the project that contains the app.config file which I modified. I suspect that the changes to the config file are not having an impact on the .exe that is deployed.

I think I must be missing something that would be really obvious to someone with a good grasp on deployment. Help much appreciated!
 
figured it out

I suppose the solution lies in knowing the first thing about the .config file.

As I suspected in last post, it is not complied into the project executable. I literally have to make a copy of the modified app.config file, but rename it to <my_exe_name>.exe.config, and release this file to my clients along with all the other dlls and exe. (I do not know what, if any, action would be needed if you are using click once deployment)

What happens is when a client machine runs the .exe, it looks for a file with the same name + ".config", as per this thread (see solution 4):
[Solved] app.config file help - CodeProject

Hope this answer will help someone in the future.
 
Back
Top