none
Deploy Windows app with report viewer RRS feed

  • Question

  • I have a windows application that works fine in development but when installed on another machine or even on the machine that I'm developing on it messes up when any kind of report is ran.

     

    I took a look at this post, which covers the problem only it is for a web application and not a windows, I've tried the same stuff except for installing everything on the server and messing with the IIS.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2723383&SiteID=1

     

    I have Microsoft.ReportViewer.Common.dll, Microsoft.ReportViewer.WinForms.dll, and the Microsoft.ReportViewer.ProcessingObjectModel.dll included in the setup and deployment project. and the correct framework is installed on all of the machines.

     

    Any suggestions? I'm going to be gone for the weekend so I won't be able to reply, but any suggestions will be greatly appreciated. I've messed around with this all day and still can't get it to work. Thanks in advance for any replies, and I'll reply back as soon as I get back if there are any questions.

     

    Thanks,

    Aaron

     

    Thursday, May 8, 2008 4:15 PM

Answers

  • Since I have some free time I figured I could explain how I fixed this a few weeks back in case someone else runs into the problem.

     

    Originally the error wouldn't show up at all, the program would just shut down. So going back into the program I eventually got the error to show. It is the same as the post in the link of my previous post, only instead of a "file not found" mine was an "unhandled exception." The problem was that the program didn't tell what the error was or where it was located. Normally this wouldn't be a problem, but when .NET 2.0 catches an unhandled exception it automatically shuts the program down So after a while I got it narrowed down to where the problem was occuring, and it was already inside of a try catch block.

     

    The funny thing about it all was that even thought it terminated the program, the report would be displayed in a .pdf after the program closed with all of the correct information. So the program was connecting to the database, pulling all of the correct information, and displaying that information, but still closing. So I found this code and put it in app.config

     

    Code Snippet

    <runtime>

    <legacyUnhandledExceptionPolicy enabled="true"/>

    </runtime>

     

     

    This code basically just ignores the unhandled exception message, the program now works flawlessly and I still to this day do not know why it threw that error. So if anyone has any idea then I'm all ears.

     

    The link above is a great resource if the program doesn't include the .dll's in your deployment project and you need to know their location and also has some other solutions that didn't work for me, but may for others.

     

    Hope this helps someone out later who has the same problem,

    Aaron

    Thursday, May 22, 2008 2:28 PM