![]() |
|
|
Published: Wednesday, December 12, 2001 By Anthony Hart
Summary (a note from Scott Mitchell...)
Introduction
Deploying Web Applications vs. Deploying Software Applications You can imagine my elation when I was introduced to ASP! I could actually program for the Internet! Wow! One of ASP's greatest strengths, which is really a strength of the medium more so than a strength of ASP specifically, is that upgrading and modifying your Web application is really easy and happens in real-time. Compare that to a program like Microsoft Office, where you have to go to a store and buy a cardboard box with little plastic discs inside to obtain the new features and functionality. Simply put, you don't have to go tell a bunch of disgruntled users that they need to download and install the latest updates to the application. All you need to do is update your application on one server and away you go. No installation files, no registry games, no caked-on dirt, no streaking, no mess – and don't forget the fresh lemony scent. Another strength of ASP applications (and, again, Internet applications in general), is that they are accessible from virtually anywhere and from various devices. The user is not limited to sitting at his desk, using one particular computer to access the application. Clearly Web applications have advantages that desktop applications do not – and vice versa. While ASP applications are easier to deploy and update, desktop applications allow for more control and provide a better experience altogether since they can be much larger in size and scope. As developers we are often faced with the dilemma of either giving up the power of a compiled application for the flexibility and ease of deployment of an ASP application, or we sacrifice wonderful interconnectivity in order to retain the power and dependability of a desktop application. We have to rob Peter to pay Paul, so to speak.
.NET's Auto Deployment to the Rescue Now, there's not a whole lot of documentation on this topic so far (at least, I had a heck of a time finding any), so consider yourself lucky if you are reading this article. As a matter of fact, in the first part of September, I went to Microsoft's .NET Developers' Tour and they only mentioned it in passing and then moved on to another topic. In the manual they gave us, the only semi-helpful text I could find about auto deployment was as follows: With a Windows Forms application, it is unnecessary to deploy an application to the end user's desktop. Instead, a user can invoke the application simply by typing a URL into a browser. The application will download to the client machine, run in a secure execution environment and it can remove itself upon completion. No examples, no further explanation, no references to Web sites or literature where I could learn more, so I'm here today to explain to you how this whole thing works. First, you develop a .NET WinForms application just as you normally would. Compile it as an EXE or DLL. In the only article I found on the subject, I read where it is recommended that we compile it as a DLL, but the author doesn't explain why. In my own tests, I have found that an EXE and a DLL work equally well. That said, it actually seems to make more sense to me to compile it as an EXE – that way, if we ever decide to use it as a normal desktop application, we don't have to re-compile at all. Until I hear a reasonable explanation as to why we should use DLLs instead of EXEs, I will continue to use (and recommend) EXEs for auto deployment. Next, copy the application's files to a Web server (remember that the web server must have the .NET Framework installed on it). One of the things I really love about .NET is that installation is almost a non-issue – just copy the application to where you want it and then continue reading your Spiderman comic book.
Once you have the application installed on a Web server, you can write a very small intermediary application whose sole reason for being is to call the application residing on the Web server. This intermediary application would be simplistic, small, and very easy to distribute. There's no reason that it couldn't be emailed out to all your enterprise-wide users or downloaded from your company's FTP site. Keep in mind that the user receiving the intermediary application needs to have the .NET Framework installed on his machine. Essentially, this small intermediary application will reside on the user's machine and execute the remote application. Imagine that we wrote some sort of financial calculator that, for one reason or another, needed to be updated frequently. Rather than requiring users to continuously have to download a new version every time the program changed, we could send our users this intermediary program that, when run, would make a call to our Web server and invoke our financial calculator program. The most recent version of the program would be scuttled over to the user's machine and run from there. Now that we've examined the foundation of auto-deployment in .NET, it's time to look at some code, which we'll do in Part 2.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||