VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run
VB.NET .exe file unable to run VB.NET .exe file unable to run
VB.NET .exe file unable to run
Go Back  Xtreme Visual Basic Talk > > > VB.NET .exe file unable to run


Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2013, 09:56 AM
Opaquer Opaquer is offline
Newcomer
 
Join Date: Mar 2013
Posts: 4
Default VB.NET .exe file unable to run


Hey guys! First post here, so sorry if this is in the wrong section. I did a quick search and couldn't find much about this though, which is unfortunate

Basically, I'm trying to make a database system that will allow a youth group I'm in to be able to sort out our database a lot better, and be more efficient when calling the kids we look after.

My idea was to make a program that reads an excel file (the current database we have is in an excel file). It then makes a text file in a specified folder about each kid (so, for example, John Smith.txt would open up all the info about John Smith). Now, that's not an improvement on itself, but that's the unsorted folder. The sorted folder then sorts the kids into different grades, regions, and into families, so I could easily call all families with last name from A-F, then someone else could take families G-M etc. Or, I could call all the kids in grade 3, while someone else takes all of the kids in grade 4 etc, and same with regions (or cities/suburbs/states/whatever you want to call them).

In the sorted folder, instead of having a text file with all the kids again, it's got a Windows shortcut, so if you edit John Smith.txt, all the shortcut files will still direct to the text file and give you updated info .

So, I've made the program, tested it out, works perfectly from my end. I make it into .exe file, put it into separate folder, add a read me and a sample database, and run it, still works perfectly for me. I give it to my friend to run, works perfectly for him.

And then I give it to another friend, and on the 2 computers he's tried it on, before the program can even run, the error "WindowsApplication1.exe has stopped working, looking for solutions" or similar appears, and he can't run it. Thankfully he's a beta tester before everyone gets a hold of it, but I'd still like to know what's wrong so he can run it!

Does anyone have any ideas about why it's saying that, or how to fix it? In all my experience with coding (not much, but better than nothing), I haven't seen an error like this unless something went horribly wrong with the code, in which case that error would appear no matter what computer I tried it on!

Sorry for the long post, I'm tired and tend to ramble a lot when I'm tired :P

Any help is appreciated

Thanks in advance
Reply With Quote
  #2  
Old 03-31-2013, 11:57 AM
Gruff's Avatar
GruffVB.NET .exe file unable to run Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Are you using 'click once' to deploy the app?

By default 'click once' automatically runs an app directly after install.
If there are any run-time conditions that are not met the program crashes.

Since your messing about with folders and files
you might want to check if any are missing on the target machine.
Ideally you should be wrapping 'try catch end try ' structures around
around disk access in your code.

BTW a single simple Microsoft database can do
what you are trying to do with text files and folders.

You write your program such that it reads and writes to the db.
Searching, filtering, and sorting are a breeze.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #3  
Old 03-31-2013, 06:55 PM
Opaquer Opaquer is offline
Newcomer
 
Join Date: Mar 2013
Posts: 4
Default

Thanks for your reply!

I'm not using "click once to deploy", though it sounds interesting. What is it? I just use the "build application" to get an exe file of the program. Also, in the properties, I disabled "Enable application framework".

All the files that I have in the folder are on the other machine - the .exe file, a .pdb file, a .xmp file, ExcelImport.dll (for the excel stuff) and IWshRuntimeLibrary.dll (for the shortcut stuff).

As for the database - I've never had any luck making a database, despite my attempts, and this seemed like more fun to me :P. Also, there are some things that my program does that I don't know how viable it would be to do in a database program
Reply With Quote
  #4  
Old 03-31-2013, 07:43 PM
Gruff's Avatar
GruffVB.NET .exe file unable to run Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Click Once is a deployment tool that comes with vb.net 2010. It determines all the components your program will need and creates a setup package on a cd or network drive.
There are other set up package options, but those are the simplest. Look up tutorials on click once.

Regarding using a database. Link
__________________
Burn the land and boil the sea
You can't take the sky from me


~T

Last edited by Gruff; 04-01-2013 at 02:19 PM.
Reply With Quote
  #5  
Old 04-01-2013, 12:56 AM
PlausiblyDamp's Avatar
PlausiblyDampVB.NET .exe file unable to run PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Do the computers that are having problems have the correct version of the .Net framework installed?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #6  
Old 04-01-2013, 04:28 AM
Opaquer Opaquer is offline
Newcomer
 
Join Date: Mar 2013
Posts: 4
Default

Quote:
Originally Posted by Gruff View Post
Click Once is a deployment tool that comes with vb.net 2010. It determines all the components your program will need and creates a setup package on a cd or network drive.
There are other set up package options, but those are the simplest. Look up tutorials on lone.

Reguarding using a database. Link
I have VB.NET 2008. Started off with it and never really upgraded :P

Quote:
Originally Posted by PlausiblyDamp View Post
Do the computers that are having problems have the correct version of the .Net framework installed?
That's a very good question... I have a feeling maybe not. I disbaled the application framework if that makes any difference? But I think one of the computers I'm trying this out on has had another one of my programs work before, though I could be wrong?
Reply With Quote
  #7  
Old 04-01-2013, 09:24 AM
AtmaWeapon's Avatar
AtmaWeaponVB.NET .exe file unable to run AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

"Application Framework" just tells VB to generate a lot of code that enables default form instances, automatic application settings, and a handful of other features that are nice to have but aren't always needed. It is very unlikely that this is the source of your problems, so don't worry about it.

The crash behavior of programs on machines without an SDK installed makes figuring out exactly what happened difficult. On a system with a debugger, generally you get a chance to start the debugger and at least see what the exception was (if you get that far into the program.) Have a peek inside Event Viewer, run the program, then see if any Application log failures appear. You might get lucky and end up seeing an exception name. Or, if you see a failure that says something to the effect of not being able to find "mscoree.dll" then the machine does not have the .NET Framework installed.

That'd be the first thing I'd check. There's probably easier ways, but a good test is to just create a plain old application that does nothing and try to run it. If that fails, you know the .NET Framework's your problem. For VS 2008 it'd be odd to find a Vista or newer machine without .NET 2.0 but it's /possible/. The easiest way to fix it is to point your browser at Smallest Dot Net, but since you /specifically/ need .NET 2.0 that might not work. Your life will be a little easier from a deployment standpoint if you at least upgrade to VS 2010, though the free versions of 2012 are a heck of a lot easier to find and there's no reason to avoid them. (If anything, it helps people tell you where in the IDE certain things are.)

If .NET isn't the problem, then some small changes can shed some light on what's going wrong. (My guess is one of your DLLs or their dependencies isn't being deployed.)

Does your application have a Sub Main()? It probably doesn't, and this is a little easier from a Sub Main(). So open your project properties and dig in the tabs until you find the "Startup Object" dropdown. It's probably set to "Form1" or whatever your main form is. There should be a "Sub Main" choice in the dropdown, pick it. Then add a new Module to the project. I usually call mine "Program.vb". Then it should look something like this:
Code:
Module Program

    Public Sub Main()
        Application.EnableVisualStyles()
        ' You have to edit this line to use your startup form.
        Application.Run(New Form1()) 
    End Sub

    Public Sub UnhandledExceptionHandler(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
        Dim exceptionObject As Object = e.ExceptionObject
        System.IO.File.WriteAllText("error.txt", e.ToString())
    End Sub
End Module
This is a /little/ bit of a gamble because it's /possible/ it won't have permission to write the file to its own directory. But if it "succeeds", then it will create a file error.txt that contains a dump of whatever the exception thought was important. Every bit of information helps.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #8  
Old 04-01-2013, 09:28 AM
Opaquer Opaquer is offline
Newcomer
 
Join Date: Mar 2013
Posts: 4
Default

Quote:
Originally Posted by AtmaWeapon View Post
"Application Framework" just tells VB to generate a lot of code that enables default form instances, automatic application settings, and a handful of other features that are nice to have but aren't always needed. It is very unlikely that this is the source of your problems, so don't worry about it.

The crash behavior of programs on machines without an SDK installed makes figuring out exactly what happened difficult. On a system with a debugger, generally you get a chance to start the debugger and at least see what the exception was (if you get that far into the program.) Have a peek inside Event Viewer, run the program, then see if any Application log failures appear. You might get lucky and end up seeing an exception name. Or, if you see a failure that says something to the effect of not being able to find "mscoree.dll" then the machine does not have the .NET Framework installed.

That'd be the first thing I'd check. There's probably easier ways, but a good test is to just create a plain old application that does nothing and try to run it. If that fails, you know the .NET Framework's your problem. For VS 2008 it'd be odd to find a Vista or newer machine without .NET 2.0 but it's /possible/. The easiest way to fix it is to point your browser at Smallest Dot Net, but since you /specifically/ need .NET 2.0 that might not work. Your life will be a little easier from a deployment standpoint if you at least upgrade to VS 2010, though the free versions of 2012 are a heck of a lot easier to find and there's no reason to avoid them. (If anything, it helps people tell you where in the IDE certain things are.)

If .NET isn't the problem, then some small changes can shed some light on what's going wrong. (My guess is one of your DLLs or their dependencies isn't being deployed.)

Does your application have a Sub Main()? It probably doesn't, and this is a little easier from a Sub Main(). So open your project properties and dig in the tabs until you find the "Startup Object" dropdown. It's probably set to "Form1" or whatever your main form is. There should be a "Sub Main" choice in the dropdown, pick it. Then add a new Module to the project. I usually call mine "Program.vb". Then it should look something like this:
Code:
Module Program

    Public Sub Main()
        Application.EnableVisualStyles()
        ' You have to edit this line to use your startup form.
        Application.Run(New Form1()) 
    End Sub

    Public Sub UnhandledExceptionHandler(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
        Dim exceptionObject As Object = e.ExceptionObject
        System.IO.File.WriteAllText("error.txt", e.ToString())
    End Sub
End Module
This is a /little/ bit of a gamble because it's /possible/ it won't have permission to write the file to its own directory. But if it "succeeds", then it will create a file error.txt that contains a dump of whatever the exception thought was important. Every bit of information helps.
Thanks for this! The thing is, I've got 2 beta testers now, and they both can't run it, even though they have both been able to run another one of my programs on the same computers from a few weeks ago :S. Would it be worth trying that Sub Main() thing? If I may ask, what exactly does it do? I haven't used modules as such before, so not quite sure what it is :S?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run VB.NET .exe file unable to run
VB.NET .exe file unable to run
VB.NET .exe file unable to run
 
VB.NET .exe file unable to run
VB.NET .exe file unable to run
 
-->