Need good design for startup project



I'm building a winforms app using 1.1 and have 3 basic tiers on the
client side. the UI, BLL and DAL. Currently everything is in one project
and at some point I'll parse it out to a separate project for each Tier.

Currently the startup object is Sub Main in the form called frmMain.
frmMain is open through the life of the application session. What happens
is from Sub Main it runs this code to get things started correctly:

Shared Sub Main()
System.Windows.Forms.Application.Run(New frmMain)
Catch ex As Exception
End Try
End Sub

Then the Load event opens the login form before frmMain has a chance to be
visible. If the login succeeds, then frmMain continues to open. If the
login is canceled, then frmMain exits and the application quits.
What I want to do is parse the login form into a new project and make that
the startup project. Then as the user logs in it can check for updates and
more easily replace any of the other DLLs (UI, BLL or DAL) with out having
to replace its self (if I left the login form as part of the UI exe then I
think it would be more difficult to upgrade the UI exe as it would have to
replace itself.).

I know there are new things coming available like no touch deployment, but
I'm thinking that this design will still make things easier down the road
when I use a better technology for automatic updates.

So my question is:
Can anyone give some advise on this strategy and; if frmMain is in the UI
dll rather than being in the startup project, how can I make the login form
go away and have frmMain persist as the main form through out the
application session?


Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your post!!

Based on my understanding, you want to get some suggestion on how to
achieve dynamic update and how to create a startup form for login.

I think this is a design issue, which we have many options available.

For me, I think I can introduce one way:
We can leverage the ShadownCopy function of AppDomain and use it to provide
the update function. This technical is documented in Eric Gunnerson's
"AppDomains and Dynamic Loading"

In this architecture, we required 2 AppDomains, one is starup domain, which
we can place the Login form in. After login, we can leverage AppDomainSetup
class to invoke the second AppDomain, in which we can place the other
business logic. Also, with the Shadow copy function enabled, we can
naturally get the update function. For more information, you may refer to
that article.(There is also a sample project in that article)

Anyway, I think there should be some other good design options. I hope some
experience community members can share their thought on this. Thanks
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
This posting is provided "as is" with no warranties and confers no rights.

Jeffrey Tan[MSFT]

Hi moondaddy,

Does my reply make sense to you? If you still need help on this issue,
please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
This posting is provided "as is" with no warranties and confers no rights.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question