after build exe
Page 1 of 1
after build exe a error msg occurs
#1
Posted 24 May 2009 - 06:41 PM
After i build the database at desktop, a setup occurs in my desktop.when i click the setup to install.Then i get a new program at my startup, and i click the new installed program, i get this error message.
At the details,
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\welight_meng\Local Settings\Apps\2.0\X7OYGH9Z.28D\Y69OHDD9.MJB\labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4\mystudents.txt'.
File name: 'C:\Documents and Settings\welight_meng\Local Settings\Apps\2.0\X7OYGH9Z.28D\Y69OHDD9.MJB\labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4\mystudents.txt'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at System.IO.File.OpenText(String path)
at makmal.Form3.Form3_Load(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.ContainerControl.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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Lab Database
Assembly Version: 1.0.3430.38035
Win32 Version: 1.0.3430.38035
CodeBase: file:///C:/Documents%20and%20Settings/welight_meng/Local%20Settings/Apps/2.0/X7OYGH9Z.28D/Y69OHDD9.MJB/labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4/Lab%20Database.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Anyone help me?i can provide the code if anyone want the code for further information.
At the details,
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\welight_meng\Local Settings\Apps\2.0\X7OYGH9Z.28D\Y69OHDD9.MJB\labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4\mystudents.txt'.
File name: 'C:\Documents and Settings\welight_meng\Local Settings\Apps\2.0\X7OYGH9Z.28D\Y69OHDD9.MJB\labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4\mystudents.txt'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at System.IO.File.OpenText(String path)
at makmal.Form3.Form3_Load(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.ContainerControl.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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Lab Database
Assembly Version: 1.0.3430.38035
Win32 Version: 1.0.3430.38035
CodeBase: file:///C:/Documents%20and%20Settings/welight_meng/Local%20Settings/Apps/2.0/X7OYGH9Z.28D/Y69OHDD9.MJB/labd..tion_37c629b09a2d04a0_0002.0001_414f206230faced4/Lab%20Database.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Anyone help me?i can provide the code if anyone want the code for further information.
#3
Posted 25 May 2009 - 01:08 AM
searockruz, on 24 May, 2009 - 10:44 PM, said:
have you included the mystudents.txt file in your setup
have you checked where is the file is placed after it gets installed
post your code so that i can help you
have you checked where is the file is placed after it gets installed
post your code so that i can help you
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If NotFirstTime = False Then
NotFirstTime = True
Me.Hide() 'Me refers to the form you are on
secondForm.ShowDialog()
End
End If
TextBox8.Text = "None"
Dim sr As IO.StreamReader = IO.File.OpenText("mystudents.txt")
Dim z, k As Integer
Dim temp As String
Dim i As Integer
numcourses = 0
arraysize = 0
ListBox2.Items.Clear()
#11
Posted 25 May 2009 - 05:06 AM
searockruz, on 25 May, 2009 - 04:49 AM, said:
first tell me how you created your setup
my problems solved by run and type the destination file.
But i want delete the student.txt and run the program smoothly.Can u help me?
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sr As IO.StreamReader = IO.File.OpenText("mystudents.txt")
Dim z, k As Integer
Dim temp As String
Dim i As Integer
RadioButton1.Enabled = True
GroupBox2.Enabled = False
GroupBox1.Enabled = True
indexValue = 0
numcourses = 0
arraysize = 0
ListBox2.Items.Clear()
RadioButton1.Checked = True
Do While sr.Peek <> -1
students(z).last = UCase(sr.ReadLine)
students(z).first = UCase(sr.ReadLine)
students(z).semester = UCase(sr.ReadLine)
students(z).HSgradyear = UCase(sr.ReadLine)
students(z).yearslastmath = UCase(sr.ReadLine)
students(z).IDnumber = UCase(sr.ReadLine)
students(z).CCstudent = UCase(sr.ReadLine)
ReDim Preserve students(z).courses(7)
For i = 0 To 7
students(z).courses(i).coursenumber = UCase(sr.ReadLine)
students(z).courses(i).instructor = UCase(sr.ReadLine)
Next i
students(z).otherschool = UCase(sr.ReadLine)
students(z).nameschool = UCase(sr.ReadLine)
students(z).StudentVisits = students(z).StudentVisits
ListBox2.Items.Add("Record #" & Str(z + 1))
ListBox2.Items.Add("Last: " & "" & students(z).last)
ListBox2.Items.Add("First: " & "" & students(z).first)
ListBox2.Items.Add("Semester " & "" & students(z).semester)
ListBox2.Items.Add("Years : " & "" & students(z).HSgradyear)
ListBox2.Items.Add("Hours In Lab " & "" & students(z).yearslastmath)
ListBox2.Items.Add("ID#: " & "" & students(z).IDnumber)
ListBox2.Items.Add("CC Students: " & "" & students(z).CCstudent)
'**********************************************
For k = 0 To 7
temp = Str(k + 1) & "). " & students(z).courses(k).coursenumber & " " & students(z).courses(k).instructor
ListBox2.Items.Add(temp)
Next k
ListBox2.Items.Add("Otherschool: " & "" & students(z).otherschool)
ListBox2.Items.Add("Name of School: " & "" & students(z).nameschool)
z = z + 1
ListBox2.Items.Add("*******************************************")
'**********************************************
Loop
arraysize = z
sr.Close()
End Sub
#12
Posted 25 May 2009 - 05:19 AM
dude theres nothing wrong with your code
you are forgetting to include your text file with other files
thats the reason your exe cannot find the text file [after installation]
the error exists in your setup,you have not created it properly
and you should include your code in try catch blocks
so that your application wont quit after error
you are forgetting to include your text file with other files
thats the reason your exe cannot find the text file [after installation]
the error exists in your setup,you have not created it properly
and you should include your code in try catch blocks
Try
Dim sr As IO.StreamReader = IO.File.OpenText("mystudents.txt")
Catch
MessageBox.Show("Cannot find text file","Error")
End Try
so that your application wont quit after error
This post has been edited by searockruz: 25 May 2009 - 05:20 AM
#13
Posted 25 May 2009 - 05:59 AM
searockruz, on 25 May, 2009 - 05:19 AM, said:
dude theres nothing wrong with your code
you are forgetting to include your text file with other files
thats the reason your exe cannot find the text file [after installation]
the error exists in your setup,you have not created it properly
and you should include your code in try catch blocks
so that your application wont quit after error
you are forgetting to include your text file with other files
thats the reason your exe cannot find the text file [after installation]
the error exists in your setup,you have not created it properly
and you should include your code in try catch blocks
Try
Dim sr As IO.StreamReader = IO.File.OpenText("mystudents.txt")
Catch
MessageBox.Show("Cannot find text file","Error")
End Try
so that your application wont quit after error
THX.I want to ask how to include the text file with other files?
This post has been edited by ankiesiau: 25 May 2009 - 06:29 AM
#14
Posted 25 May 2009 - 09:15 AM
Error handling for beginners
Setup tutorial
if you have a problem post back
Setup tutorial
if you have a problem post back
This post has been edited by searockruz: 25 May 2009 - 09:19 AM
#15
Page 1 of 1

Add Reply




MultiQuote

| 


