No, I used ClickOnce deployment. Here is some code...
The entry poin for my app is sub main:
Public Class Program
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
If LoginForm.Login() Then
Application.Run(New MainForm())
End If
End Sub
End Class
LoginForm Class:
Public Class LoginForm
Private mManager As PersistenceManager
Private Sub New()
InitializeComponent()
mManager = PersistenceManager.DefaultManager
End Sub
Public Shared Function Login() As Boolean
Dim aLoginForm As New LoginForm()
Dim aDialogResult As DialogResult = aLoginForm.ShowDialog()
aLoginForm.Dispose()
Return Windows.Forms.DialogResult.OK
End Function
Private Sub OK_Click(...) Handles btnOK.Click
DoLogin()
End Sub
Private Sub Cancel_Click(...) Handles btnCancel.Click
Me.DialogResult = Windows.Forms.DialogResult.Cancel
End Sub
Private Sub DoLogin()
If Not InputIsValid() Then Return
Try
'Some authentication code...
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Catch pException As Exception
MessageBox.Show(pException.Message)
End Try
End Sub
End Class
If I comment out the red line code, my LoginForm shows without delay, otherwise it takes time depending on machine config...
Originally, there was no PersistenceManager in the LoginForm and it showed up fast. I just placed the creation of PM into this form for testing purposes.