School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,162 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,039 people online right now. Registration is fast and FREE... Join Now!



after build exe

Page 1 of 1

after build exe a error msg occurs Rate Topic: -----

#1 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

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.

Attached thumbnail(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -


#2 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 24 May 2009 - 10:44 PM

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
Was This Post Helpful? 0
  • +
  • -

#3 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 01:08 AM

View Postsearockruz, 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


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()

Was This Post Helpful? 0
  • +
  • -

#4 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 25 May 2009 - 01:13 AM

make sure that mystudents.txt file is in the same folder of your exe
Was This Post Helpful? 0
  • +
  • -

#5 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 01:27 AM

View Postsearockruz, on 25 May, 2009 - 01:13 AM, said:

make sure that mystudents.txt file is in the same folder of your exe


i hv try to put the students.txt file with exe but the error msg still occurs.
Was This Post Helpful? 0
  • +
  • -

#6 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 25 May 2009 - 01:31 AM

are you sure you have added the text file to your setup.And if you have added it just check it goes in the same folder where exe gets installed
Was This Post Helpful? 0
  • +
  • -

#7 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 02:19 AM

View Postsearockruz, on 25 May, 2009 - 01:31 AM, said:

are you sure you have added the text file to your setup.And if you have added it just check it goes in the same folder where exe gets installed


HERE

Attached thumbnail(s)

  • Attached Image
  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • The Bandido Coder
  • Icon
  • View blog
  • Group: Moderators
  • Posts: 3,289
  • Joined: 29-May 08


Dream Kudos: 4050

Expert In: vb.net, LINQ

Posted 25 May 2009 - 02:41 AM

There not in the same folder. If you look at the second screen shot, I'll see the its a shortcut to the exe.
Was This Post Helpful? 0
  • +
  • -

#9 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 04:37 AM

View PostAdamSpeight2008, on 25 May, 2009 - 02:41 AM, said:

There not in the same folder. If you look at the second screen shot, I'll see the its a shortcut to the exe.


Problem solved.Thanks.

This post has been edited by ankiesiau: 25 May 2009 - 05:02 AM

Was This Post Helpful? 0
  • +
  • -

#10 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 25 May 2009 - 04:49 AM

first tell me how you created your setup
Was This Post Helpful? 0
  • +
  • -

#11 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 05:06 AM

View Postsearockruz, 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

Was This Post Helpful? 0
  • +
  • -

#12 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

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

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

Was This Post Helpful? 0
  • +
  • -

#13 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 05:59 AM

View Postsearockruz, 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

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

Was This Post Helpful? 0
  • +
  • -

#14 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 25 May 2009 - 09:15 AM

Error handling for beginners

Setup tutorial

if you have a problem post back

This post has been edited by searockruz: 25 May 2009 - 09:19 AM

Was This Post Helpful? 0
  • +
  • -

#15 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 25 May 2009 - 07:27 PM

View Postsearockruz, on 25 May, 2009 - 09:15 AM, said:

Error handling for beginners

Setup tutorial

if you have a problem post back


i still don't understood and don't hv File System editor.

This post has been edited by ankiesiau: 25 May 2009 - 08:24 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month