I compiled a project I made in visual studio 2008, but for some reason it only works on the computer it was created on, on any other computer I just get the "... has encountered and error and needs to be closed..." error message.
At first I thought it was cause I didn't install frameworks 3.5 on the other computer, but installing it solved nothing.

Any help would be appreciated.

do you use any external dll as reference in your project? if so you need to ship them out with your applcation.
i.E you set a reference to ftp.dll then you need to hand out the interop.ftp.dll which is located in your Release folder.

No dll used, just a database which is in the rar along with the exe.
I even tried downloading the rar, extracting and using, still it works on the original pc and nowhere else.

ok can you please paste the first 5 lines from the error in here?
when the error occurs click on detail and copy the 5 lines. this might tell us whats going on

EventType : clr20r3 P1 : coder.exe P2 : 1.0.0.0 P3 : 4a967734
P4 : coder P5 : 1.0.0.0 P6 : 4a967734 P7 : d P8 : c6
P9 : system.invalidoperationexception

Thanks for trying to help :D

uhm that looks more like an error report to microsoft instead of the error i meant :o

you might attach your compiled exe (zipped) and i can check

ps. if its an trojan im gonna rip your head :p

A trojan with a database? =)
hope it was attached (change the extension to rar, it wouldn't allow me to upload it otherwise)

Thank you very much for all your help.

if everything is working please mark this thread as solved. ty =)

Sorry, I had unsolve it.
After getting to trying to fix it again (busy weekend), I found out that even after installing microsoft visual basic 3 (I used 1.2 in the project) it still does does not work.
Still the same error:

EventType : clr20r3 P1 : coder.exe P2 : 1.0.0.0 P3 : 4a967734
P4 : coder P5 : 1.0.0.0 P6 : 4a967734 P7 : d P8 : c6
P9 : system.invalidoperationexception

alright
you have set the reference to the VB Power packs 3.0 in your project?
if not then do so!
After this select the new added reference and go to the Properties and set "Copy Local" to TRUE.
compile and you will then find the Microsoft.VisualBasic.PowerPacks.dll in your Release folder.

if the error still occurs please do not post the entries from the microsoft report. you should add some try-ctach blocks in your code and paste the exception message instead.

If your application crashes before Application.Run is called and the process enters the main loop then try..catch blocks will not catch the exception, nor will the Application.ThreadException event.

What you need to do in this case is run the application and redirect the stdout/stderr to a file and read the information.

S:\>AppName.exe >> debug.txt 2>&1

After the application crashes out then take a look at debug.txt and you will have much more useful information.

commented: ty. didnt know that :D +1
commented: N.A +13

This is driving me insane.
I did what you said with the file, unfortunately my OS is in my native language, and therefore attaching the file would be useless.

Despite that, I can figure out from the file that it could not locate the file of the power pack, although on the original pc I managed to add a reference which uses the dll from withing the folder, and checked to see that an error message appears when the file is moved to another location other than the folder of the exe.

Is it possible that the thing which is missing is the registry values involved with the powerpack? if so, how can I identify that it is indeed the problem? The powerpack is microsoft visual basic powerpack 1.1.

Thanks a lot.

The solution was a lot less technological and a lot more just plain... stupid.
I accidently copied the wrong folder causing myself to use a previous version without the reference. :P

Thanks a lot for all the help.

(couldn't find the edit button)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.