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.vbinPartial Class frmMaininPrivate Sub InitializeComponent()works properly. This is checked by making a breakpoint at the begin ofSuband going step-by-step through the code untilEnd Sub. - Code in
frmMain.vbinPublic Class frmMaininPrivate Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Loadis 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
cmdClosebutton on the same child form closes the form. Button hasDialogResultproperty set toCancel. Form itself hasCancelButtonproperty set tocmdClose. PressingESCalso closes the form.Private Sub cmdClose_Click(sender As Object, e As EventArgs) Handles cmdClose.Click Me.Dispose() End SubClosing the main form (no matter if by "X",
cmdClosebutton orESC) hangs up the application.Private Sub cmdClose_Click(sender As Object, e As EventArgs) Handles cmdClose.Click Me.Close() End SubIf I open Windows Explorer and go to the final location of application on shared network drive starting from the mapped drive
Y:\folderand start application from there - it works.- However if choose the same final destination through
\\server\share-name\folderand 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 pathto 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?