[RESOLVED] [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
When i Debug in the Code in VB environment No error But when i Build The Realse Exe and Try to Run it i Got this Error:
an exception "system.io.filenotfoundexception' has occurred in file.exe
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
I'm just guessing here, but as the exception suggests it means that there is a file you are trying to access that does not exist.
My best guesstimate (unless there is another place in the code where you are trying to access a file) is that the code wbrShow.Navigate(...) is generating that error. I'd print out the result from this - (Link & Mofaser & "/" & iSouraNo.ToString("000") & iAyaNo.ToString("000") & ".html") - in a message box and check that it is a valid link....
EDIT: I guess you should also check that any files that you are accessing are in the Release directory as well as the debug directory...
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
Wouldnt you get errors at this line:
VB Code:
Dim iAyaNo As Integer = cmbAya.Text
You are trying to assign a string variable to an integer, which is a no-no.
You would probably benefit from turning Option Strict On and Option Explicit On, because if you have it on, it will show an error in the IDE when you try to do that... with cute little blue squigglies
Last edited by gigemboy; Mar 31st, 2006 at 01:10 AM.
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
You say that your app throws an exception. What are you attempting to do when this happens? That should give you a clue as to where in the code the exception is thrown.
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
Originally Posted by gigemboy
Wouldnt you get errors at this line:
VB Code:
Dim iAyaNo As Integer = cmbAya.Text
You are trying to assign a string variable to an integer, which is a no-no.
You would probably benefit from turning Option Strict On and Option Explicit On, because if you have it on, it will show an error in the IDE when you try to do that... with cute little blue squigglies
I did Not Get The Error :s
And I Used this Way to get the String format ("000") to get the Numbers as 001, 002, 033, 125, etc .
Because I Tried Format(cmbAya.Text, "000") but it doesnt work
This is The Prophet MOHAMMAD!
=======================
My SuperMen:
RhinoBull, gigemboy, jmcilhinney, |2eM!x, Edneeis and Hack
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
Of course there's a solution. It's hard for us to diagnose it without being able to see the app in action. You need to add some logging to your app so that you can track what it's doing and see exactly where it was up to when the issue occurred.
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
Logging means to keep a log, as in your app needs to record its activities somewhere. I believe that there are some diagnostic logging features built in but I've never used them. You could use the event log but I don't think that would be appropriate for this situation. A simple option would be to just write to a text file. You could write a line at the beginning and end of each constructor, in your Main method, etc. Once you know which method was enetered and not exited then you can look more closely at that method, perhaps adding a log entry after each line if necessary.
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
The error is probably because it cant find the interop dll's inside of the directory that it is sitting in...
I built the program, in release mode, and it ran fine.
When you "build a release", are you creating a setup project?? You have to create a setup project by making a setup project, then it will detect the dependencies, and you can change the "copylocal" property to "true" for those dll's...
***EDIT - you are probably clicking on what is in the Release folder in the obj folder. You shouldn't do that. When you change it to "release", it rebuilds everything inside of the bin folder, so just run the exe from the bin folder.
Last edited by gigemboy; Apr 1st, 2006 at 01:11 AM.
Re: [02/03] an exception "system.io.filenotfoundexception' has occurred in file.exe
You add a new setup project to your solution. The setup project should detect the dependencies and give you options to register, etc when you view the dll's properties... searching the forum for "setup project" or something to that matter will pull several examples...