Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Auto-Deploying Windows Forms .NET Applications: The Revenge of the Fat Client : Page 6

.NET Automatic Deployment is a feature built into the .NET Framework, allowing applications to download assemblies (via HTTP) from remote locations on an as-needed basis.


advertisement
Assembly.LoadFrom Revisited
Now, let's review what .NET does behind the scenes when you use the Assembly.LoadFrom method to load an assembly from a remote location. Let's take this code for example:

'Define URL. Dim URL As String URL = _ "http://localhost/CodeDownLoadDemo/ModuleA.DLL" 'Load assembly from the URL defined above. Dim a As [Assembly] a = [Assembly].LoadFrom(URL)

When .NET executes the LoadFrom method, it goes to the URL http://localhost/CodeDownloadDemo and looks at the ModuleA.DLL assembly on the Web server. .NET verifies whether you have downloaded this assembly before. If you never have, .NET downloads this assembly and stores it in the .NET Assembly Download Cache.

The second time you run this same code, .NET realizes that the assembly has been downloaded before. If the version in the Web server is the same as the one that you have in your Assembly Download Cache, .Net uses the one that you already have on disk.

Let's say that you run this code a third time and .NET realizes that the version on the Web server is more recent than the one that you have on disk. .NET automatically downloads the new version, stores it in the Assembly Download Cache, and runs it.

The Assembly Download Cache is a special folder located under c:\windows\assembly\download. Figure 15 shows how the assembly cache looks on my computer.



Hector J. Correa is a Software Architect with Vision Data Solutions, a consulting company in the Kansas City area. Hector holds a B.S. in Computer Engineering from Colima's Institute of Technology and he is a Microsoft Certified Solution Developer. You can reach him at hcorrea@visionds.com
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Thanks for your registration, follow us on our social networks to keep up-to-date