.NET Framework and Visual Studio Tools for Office

The .NET Framework is the backbone of VSTO. What is actually in the .NET Framework? Well, it is loaded with hundreds of classes and interfaces! Here are its main layers:

  • VB.NET. One of the languages that you can use to write code in VSTO is Visual Basic - or more in particular, VB.NET.
  • ASP.NET Forms. There are Interfaces for Windows Forms, Web Forms, and Web Services. In order to use Web Services, you may have to install extra components.
  • ADO.NET XML. In the background, much code is automatically converted into XML to deal with remote access, so you are off the hook yourself.
  • BCL. BCL holds very powerful class libraries such as System.Math, System.IO, System.Windows, System.Drawing, and System.Data.
  • CLR. CLR takes care of memory use, common data types, security, garbage collection, and much more.

What are CLR and BCL? Perhaps you remember the VB Runtime in VB 6.0. It provided some very powerful services such as the following:

  • Automatic memory management: Destroying objects and variables once they go out of scope
  • Safety checking on code: For example, this prevents you from referencing an array outside its boundaries
  • Functions: For things like string manipulation (InStr), user input (MsgBox), and type conversion (CInt)

Well, VB.NET has split these services into two separate entities, but they are much more comprehensive than before:

  • CLR (Common Language Runtime): CLR reads code produced by the VB.NET compiler, scrutinizes it before execution, and cleans up unused variables and objects (so-called garbage collection). Code that runs under the control of the CLR is called "managed" code.
  • BCL (Base Class Libraries): BCL provides many regular functions such as MsgBox (), InStr (), and UCase (). In addition, it contains many other classes and functions to perform data management and file management.