Short story
I have a weird problem and couldn't find any solution for it across internet.
This is probably not important for a problem but I prefer to mention that I had two separate projects and decided to combine them into one solution. Both projects were/are simple winform application. They worked separately after compiling: directly in Visual Studio during debugging (no matter in debug or release mode), locally outside debugger and after copying them into some folder on local network.
However after merging them, one of the application stopped working when it is started from the network.
Stop working means?
I attached debugger to the already running process and found out that:
- Code in
frmMain.Designer.vb
inPartial Class frmMain
inPrivate Sub InitializeComponent()
works properly. This is checked by making a breakpoint at the begin ofSub
and going step-by-step through the code untilEnd Sub
. - Code in
frmMain.vb
inPublic Class frmMain
inPrivate Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
is not triggered. After going out fromInitializeComponent()
(point 1) code does not enterfrmMain_Load
. Main form is shown on the screen with all controls but not initialized/cleaned, without icon etc. - Clicking some buttons on main form allows me to open child forms but they are also not initialized/cleaned.
Closing child form by clicking on "X" doesn't close the form (normally does). Clicking on
cmdClose
button on the same child form closes the form. Button hasDialogResult
property set toCancel
. Form itself hasCancelButton
property set tocmdClose
. PressingESC
also closes the form.Private Sub cmdClose_Click(sender As Object, e As EventArgs) Handles cmdClose.Click Me.Dispose() End Sub
Closing the main form (no matter if by "X",
cmdClose
button orESC
) hangs up the application.Private Sub cmdClose_Click(sender As Object, e As EventArgs) Handles cmdClose.Click Me.Close() End Sub
If I open Windows Explorer and go to the final location of application on shared network drive starting from the mapped drive
Y:\folder
and start application from there - it works.- However if choose the same final destination through
\\server\share-name\folder
and start application from there - it doesn't work. - Point 6 and 7 acts the same if application is started by a shortcut on desktop and in this shortcut
target path
to application is defined in one of the two methods.
Windows 7, .Net Framework 4.5.
Do you have any clue how to solve it and where the bug is?