• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

.NET Runtime 2.0 Error

I have written a VB.net application which executes fine.  However when I deploy the application and try to run it I get the "Event ID 5000 .NET Runtime 2.0 Error".  This occurs no matter which workstation I install the application on.  The setup project uses the 3.5 framework.  I tried creating the setup project using the 2.0 framework and receive the same error.  Any ideas on how to address this issue?
0
v4seasons
Asked:
v4seasons
4 Solutions
 
meispiscesCommented:
Refer the following link in Experts Exchange link
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_22958155.html
 
This log states there is a System.InvalidCastException exception in your application, however, the EventType clr20r3 is just a common error message showing there's an unhandled exception in your application, it offers not much help for us to find out what's going wrong.

To make the error information more sense, we can handle the AppDomain.UnhandledException event to log the error in a more meaningful way, for more information about the AppDomain.UnhandledException event, you can check this document:

http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx

After handling the AppDomain.UnhandledException event, you'll be able to know the details of the exception.

For more information about the InvalidCastException exception, you can refer to:

Debugging an InvalidCastException
http://blogs.msdn.com/suzcook/archive/2004/06/02/debugging-an-invalidcastexception.aspx

InvalidCastException Class
http://msdn.microsoft.com/en-us/library/system.invalidcastexception.aspx
Hope it helps. Please respond
0
 
v4seasonsAuthor Commented:
I an new to VS 2008 programming.  Here is my code.. I am unclear where I put this exception code so it will identify what the issue is.  Can someone assist me?  Here is my current code..
Imports CrystalDecisions.CrystalReports.Engine.ReportDocument
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms
Public Class frmReport
 
    Private Sub frmReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
        'Declare variables
 
        Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
        Dim user As String
        Dim pwd As String
 
        'User credentials to run crystal reports
 
        user = "crystal"
        pwd = "reporting"
 
 
        'Load proplan reports.  Specify number of copies, start and ending pages
 
        rpt.Load("c:\Crystal Reports\Material Plan Not Equal Usage Time.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan - Special Ship Methods.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(5, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Admanco Domestics.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan - Vitronic Screen Print Large and Small Coolers.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Admanco Imports.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 1, 15)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Apply Transfer.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 1, 8)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Calendar Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 1, 10)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Custom Etch Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Embroidery Machine Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Mugs Direct Print.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(2, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Umb Bag Jkt SP.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Hot Stamp Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Vit Pad Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(3, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Vit Print Dept No Caps.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(3, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Proplan Vit Sealing Dept.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        rpt.Load("c:\Crystal Reports\Zero Use Bill Item.rpt")
        rpt.SetDatabaseLogon(user, pwd)
        rpt.PrintToPrinter(1, False, 0, 0)
        rpt.Close()
 
        End
 
    End Sub
 
End Class

Open in new window

0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
v4seasonsAuthor Commented:
Figured out how to add the exception handling.  Although it is difficult because I believe the error is occurring when my from loads.  Here is what I was able to receive.
vb-error.doc
0
 
mlmccCommented:
What Crystal dlls did you include with the setup package?

mlmcc
0
 
v4seasonsAuthor Commented:
I actually put in this code before my form loaded since the application was ending before my form loaded or the try.. catch block was executed.  The error generated was a bit more descriptive.. after searching for awhile I ended up installing the crredist2008_x86.msi on the client computer.  This solved my issue.
Sub UnhandledExceptionEventRaised(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
        If e.IsTerminating Then
            Dim o As Object = e.ExceptionObject
            MessageBox.Show("Error: " & o.ToString)
            Debug.WriteLine(o.ToString) ' use EventLog instead
        End If
    End Sub
 
    Public Sub New()
        MyBase.New()
        AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionEventRaised
 
        Application.EnableVisualStyles()
        Application.DoEvents()
 
        'This call is required by the Windows Form Designer.
        InitializeComponent()
    End Sub

Open in new window

0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now