Results 1 to 11 of 11

Thread: [RESOLVED] Unexpected Error

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    113

    Resolved [RESOLVED] Unexpected Error

    Ok i made a program it worked fine. I changed Net Framework to 3.5, then back to version 4 (i was testing something)

    It now works fine.

    I run the program from vb.net in debug mode and everythign works fine.

    I clean the build,

    I then build the project.

    I then run the built exe but then it shows an error. The error point to this code:

    Code:
        Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            If Not My.Computer.FileSystem.DirectoryExists(wdir) Then
                My.Computer.FileSystem.CreateDirectory(wdir)
            End If
    
            If Not My.Settings.prevsearch Is Nothing Then
                If My.Settings.prevsearch <> "" Then
                    txt_g_url.Text = My.Settings.prevsearch
                    MsgBox(wdir)
                End If
            End If
    
            For Each item As String In My.Settings.prevurl
                If Not txturl.Items.Contains(item) Then
                    txturl.Items.Add(item)
                End If
            Next
        End Sub
    I cant figure out why this is. The main point is it works in debug but not after its built.


    heres the exception error:
    Code:
    ************** Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at RAF_WEB.Form1.Form1_Load(Object sender, EventArgs e) in H:\Files\VB NET\Projects\RAF_WEB\RAF_WEB\Form1.vb:line 2311
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Last edited by rafhelp; Jun 28th, 2012 at 07:36 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width