-1

I have wrote a win forms application in VB that requires some external DLLs, It installs and runs flawlessly on several machines but it does not work on one laptop! I even put Filestreams to write exceptions to a text file. While it writes intended header text to the debug file on other computers, it does not write anything to the debug file on the aforementioned laptop. My guess is that it does not even reach Form1_Load() method.

This is the structure of the program:

Import namespaces from external programs

Public Class MyApp

''Varibale declarations:

Structures and classes based on DLLs
Other declarations based on .Net Objects
Stream writer declaration and initialization for the debug file

Private Sub Form1_Load(...)

Try
    Write Start and time to the debug file

    execute commands
catch
    write debug info
end Try

End Sub

Other events and subs

End Class

IS there a way to see what happens between the initialization of the debug file and execution of Form1_Load() ??

As I said it works perfectly on all the machines that use this except one!! What are the things that I need to check on that machine?

AleX_
  • 508
  • 1
  • 6
  • 20
  • When you debug the application on your develop machine (it works there right?) you can follow the path to the Form_Load and check if something is initialized before the Form_Load. Use the step by step functionality (usually F11 but it could be different on your environment) – Steve Apr 19 '13 at 18:36
  • Make sure the laptop has the required .NET framework installed. – Jack Pettinger Apr 19 '13 at 18:37
  • Thanks Jack, it does have the required .Net framework installed, in fact its included in the perquisites. – AleX_ Apr 19 '13 at 19:14
  • @Steve, thank you very much, That F11 Tip was amazing it can be handy in the future but before I get to Form1_Load(), only a few functions are loaded that are not accessible. – AleX_ Apr 19 '13 at 20:07
  • I think I have found where the problem is! Although I have added the .dll's to the references' list and they are included in the binary folder and installation package files, some how the link between them is not working! I removed the gui stuff related to the package and the application is now running! It only once gave me an InvalidOperationException which seems to be related to [This problem discussed here](http://stackoverflow.com/questions/808867/invoke-or-begininvoke-cannot-be-called-on-a-control-until-the-window-handle-has) – AleX_ Apr 19 '13 at 21:56

2 Answers2

0

Chances are that the user of the laptop is not in the Administrators group and you're trying to write to the application program folder.

Metaphor
  • 6,157
  • 10
  • 54
  • 77
  • Thanks Metaphor, but the user is the administrator. The application folder is created, and even I double click the application, it creates my little debug file (but does not write anything to it which is the first command in form1_load()). The laptop works a minute and then nothing happens! Is there a way to put appdoamin.unhandledException to the winform program? – AleX_ Apr 19 '13 at 17:58
0

Have you tried to add a placeholder line in the debug file immediately after initialization, to check that the file is actually write-able?

Is the Form's constructor reachable? If you move the "Write Start and time to the debug file" code to the constructor, does it write anything?

C.B.
  • 666
  • 3
  • 18