View Single Post
Old 04-01-2013, 09:28 AM
Opaquer Opaquer is offline
Join Date: Mar 2013
Posts: 4

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:
Module Program

    Public Sub Main()
        ' 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