Results 1 to 2 of 2

Thread: Error occurs at the beginning

  1. #1
    jdy0803 is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Santa Clarita
    Posts
    73
    Reputation
    58

    Error occurs at the beginning

    My VB.NET program work fine from Win XP/7/8.
    However error occurs at runtime when this program is run in Windows server 2008 R2 standard and some form is opened.
    I added msgbox like following at the beginning of form_load event to investigate where this error occurs but error occurs prior to display msgbox.
    Code:
    Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
        MsgBox "---- 1 ----"
        .
        .
        .
        MsgBox "---- 2 ----"
        .
        .
        .
        MsgBox "---- 3 ----"
        .
        .
        .
        MsgBox "---- 4 ----"
    End Sub
    I attatched screen capture.
    How could I find the cause of this error?
    Can anybody give me any advice?error.png

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,776
    Reputation
    1703
    The error details includes a stack trace, which is basically the list of methods that were being executed when the exception was thrown. That call stack can often be very informative and is in this case. It tells us that you have clicked the PreferenceToolStripMenuItem in formMain and in the Click event handler you have created a formPreference object. During the creation of that object, which occurs before the Load event handler is executed, the Description property of a Leadtools.Multimedia.WMProfile is being set and that's where the NullReferenceException is being thrown, i.e. that property setter is trying to use some object that is Nothing. I'm guessing that that component is assuming something about Windows Media Player that is not the case on Windows Server.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •