Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executable is not working, but code inside VS2012 does 1

Status
Not open for further replies.

vladk

Programmer
May 1, 2001
991
US
Hi,

I built simple Windows Forms VB.NET application. It reads text files (like for Notepad) and creates another text files. At the end, it displayes a conformation message. The program works just fine from VS2012. Howevere when I run it's executable from bin/release (I built it for release), the program still produces the conformation message, but it does not build any files.

No error messages, no exceptions, nothing. It displayes final message with no files it supposed to create. I run it locally, on my hard drive.

The only library I import is System.IO, no COM, but I still use old string functions like Right, Left.

Can anybody please give me a hint on how to deal with this?

Thank you

vladk



 

Put Message Boxes at various points in your code to see if it is being executed. That or use the IO functions to write messages to a log file.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Hi jebenson,

I followed your advice and found the following.

This condition is satisfied in VS2012 and it is never satisfied in EXE:

If strTagBU.ToUpper.Trim = oCheckBox.Tag.ToString.ToUpper.Trim Then

This is how I get strTagBU:

strTagBU = strIniLine.Split("="c)(0).ToString

Inside VS2012 the values are always correct: say "ABC" and "XWZ".
However in exe they are very strange: strings of strange characters, not even letters, especially for strTagBU.ToUpper.Trim

Have no idea why it happens
 
There are more findings. I use StreamReader to read lines in text ANSI file, the regular notepad file. The lines it returns are correct in VS2012, but these lines are collections of chaotic characters, not even letters, when I run EXE.

The font is Times New Roman.

Can anybody help?
 
Are you sure the exe is reading the same file as when it is run in the IDE?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Hi jebenson,

Yes, you are right, it reads different files. The problem wos in Replace function. It looks like in IDE it is case insensitive, when in EXE it is case sensitive.

Thank you for your advices so much!

vladk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top