What is .NET Framework and the Common Language Runtime?

By: Steven Holzner Emailed: 1674 times Printed: 2154 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

VB .NET is only one component of a revolution in Windows-the .NET framework. This framework provides the new support for software development and operating system support in Windows, and it's more extensive than anything we've seen in Windows before. The .NET framework wraps the operating system with its own code, and your VB .NET programs actually deal with .NET code instead of dealing with the operating system itself. And it is specially designed to make working with the Internet easy.

At the base of the .NET framework is the Common Language Runtime (CLR). The CLR is the module that actually runs your VB .NET applications. When you create a VB .NET application, what really happens is that your code is compiled into the CLR's Intermediate Language (named MSIL, or IL for short), much like bytecodes in Java. When you run the application, that IL code is translated into the binary code your computer can understand by some special compilers built into the CLR. Compilers translate your code into something that your machine's hardware, or other software, can deal with directly. In this way, Microsoft can one day create a CLR for operating systems other than Windows, and your VB .NET applications, compiled into IL, will run on them.

The .NET Framework class library is the second major part of the .NET framework. The class library holds an immense amount of prewritten code that all the applications you create with Visual Basic, Visual C++, C#, and other Visual Studio languages build on. The class library gives your program the support it needs-for example, your program may create several forms, and as there is a class for forms in the class library, your program doesn't have to perform all the details of creating those forms from scratch. All your code has to do is declare a new form, and the CLR compilers can get the actual code that supports forms from the .NET Framework class library. In this way, your programs can be very small compared to earlier Windows applications; because you can rely on the millions of lines of code already written in the class library, not everything has to be in your application's executable (EXE) file.

All this assumes that you're working on a machine that has the .NET framework, and therefore the CLR and the .NET Framework class library, installed. The code for all elements we use in a VB .NET application-forms, buttons, menus, and all the rest-all comes from the class library. And other Visual Studio applications use the same class library, making it easy to mix languages in your programming, even in the same application. Also, distributing applications is easier, because all the support you need is already on the machine you're installing your application to.

As mentioned, the .NET framework organizes its classes into namespaces. For example, the .NET framework includes the namespaces Microsoft.VisualBasic, Microsoft.JScript, Microsoft.CSharp, and Microsoft.Win32. In fact, these namespaces contain relatively few classes; the real way we'll interact with the .NET framework class library in this book is through the System namespace.

The System Namespaces

You can't build a VB .NET application without using classes from the .NET System namespace, as we'll see over and over again in this book. When you want to use a Windows form, for example, you must use the System.Windows.Forms. Form class. A button in a Windows form comes from the System.Windows. Forms.Button class, and so on. There are many such classes, organized into various namespaces like System.Windows.Forms. Here's an overview of some of those namespaces:

  • System-Includes essential classes and base classes that define commonlyused data types, events and event handlers, interfaces, attributes, exceptions, and so on.

  • System.Collections-Includes interfaces and classes that define various collections of objects, including such collections as lists, queues, arrays, hash tables, and dictionaries.

  • System.Data-Includes classes that make up ADO.NET. ADO.NET lets you build data-handling components that manage data from multiple distributed data sources.

  • System.Data.OleDb-Includes classes that support the OLE DB .NET data provider.

  • System.Data.SqlClient-Includes classes that support the SQL Server .NET data provider.

  • System.Diagnostics-Includes classes that allow you to debug your application and to step through your code. Also includes code to start system processes, read and write to event logs, and monitor system performance.

  • System.Drawing-Provides access to the GDI+ graphics packages that give you access to drawing methods.

  • System.Drawing.Drawing2D-Includes classes that support advanced two-dimensional and vector graphics.

  • System.Drawing.Imaging-Includes classes that support advanced GDI+ imaging.

  • System.Drawing.Printing-Includes classes that allow you to customize and perform printing.

  • System.Drawing.Text-Includes classes that support advanced GDI+ typography operations. The classes in this namespace allow users to create and use collections of fonts.

  • System.Globalization-Includes classes that specify culture-related information, including the language, the country/region, calendars, the format patterns for dates, currency and numbers, the sort order for strings, and so on.

  • System.IO-Includes types that support synchronous and asynchronous reading from and writing to both data streams and files.

  • System.Net-Provides an interface to many of the protocols used on the Internet.

  • System.Net.Sockets-Includes classes that support the Windows Sockets interface. If you've worked with the Winsock API, you should be able to develop applications using the Socket class.

  • System.Reflection-Includes classes and interfaces that return information about types, methods, and fields, and also have the ability to dynamically create and invoke types.

  • System.Security-Includes classes that support the structure of the common language runtime security system.

  • System.Threading-Includes classes and interfaces that enable multithreaded programming.

  • System.Web-Includes classes and interfaces that support browser/server communication. Included in this namespace are the HTTPRequest class that provides information about HTTP requests, the HTTPResponse class that manages HTTP output to the client, and the HTTPServerUtility class that provides access to server-side utilities and processes. You can also use cookies, support file transfer, and more with these classes.

  • System.Web.Security-Includes classes that are used to implement ASP.NET security in Web server applications.

  • System.Web.Services-Includes classes that let you build and use Web services, programmable entities on Web Server that code can communicate with using standard Internet protocols.

  • System.Windows.Forms-Includes classes for creating Windows-based forms that make use of the user interface controls and other features available in the Windows operating system.

  • System.Xml-Includes classes that support processing of XML.

These, along with the many other System classes, form the foundation on which VB .NET applications rest. It's time now to start taking a look at how to build those applications.


VB.net Home | All VB.net Tutorials | Latest VB.net Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

Very informative article, this is the exact article which I'm looking for. You've elaborate it nicely. Thanks for sharing with us. Some other article also helped me in completing my task...
<a href="http://mindstick.com/Blog/11/CLR%20Common%20Language%20Runtime" title="CLR (Common Language Runtime)">CLR (Common Language Runtime) </a>

<a href="http://msdn.microsoft.com/en-us/library/ddk909ch%28v=vs.71%29.aspx" title="CLR (Common Language Runtime)">http://msdn.microsoft.com/en-us/library/ddk909ch%28v=vs.71%29.aspx </a>

Thanks Everyone for yours nice post.


View Tutorial          By: Abhinav bindra at 2012-03-23 14:00:12

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Steven Holzner
Changes in Controls from VB6 to VB.net
Throwing a Custom Exception in VB.net
Throwing an Exception in VB.net
Using Finally in VB.net
Using Multiple Catch Statements in VB.net
Exception Filtering in the Catch Block in VB.net
Raising an Exception Intentionally in VB.net
Getting an Exception's Number and Description in VB.net
Using On Error GoTo 0 in VB.net
Using Resume Next and Resume Line in VB.net
Understanding Scope in VB.net
Properties in VB.net
Procedure Delegates in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net

More Tutorials in VB.net
Scope in VB.net
Unstructured Exception Handling in VB.net
Structured Exception Handling in VB.net
Creating Sub Procedures in VB.net
Creating Functions in VB.net
Passing a Variable Number of Arguments to Procedures in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Procedure Delegates in VB.net
Properties in VB.net
Understanding Scope in VB.net
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net

More Latest News
Most Viewed Articles (in VB.net )
Your first VB.NET Crystal Reports - A step by step guide
While Loop in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Using Resume Next and Resume Line in VB.net
What is .NET Framework and the Common Language Runtime?
File Extensions Used in VB .NET
Visual Basic Statements
Update cell data in an Excel file using OLEDB in VB.net
How to export from database to excel using VB.net
How to export from DataGridView to excel using VB.net
Creating Menus in Code using VB.net
What's New in VB .NET? A comparison of VB vs VB.net
Arrays and Dynamic Arrays in VB.net
Handling Strings in VB.net
Using Select Case in VB.net
Most Emailed Articles (in VB.net)
Send SMS using VB code
String equals, Copy to & Copy to in VB.net
How to export from database to excel using VB.net
A tutorial on Chat Server and Chat Client in VB.net
Your first VB.NET Crystal Reports - A step by step guide
Socket Programming in VB.net
Handling Timer Events - and Creating an Alarm Clock in VB.net
File Extensions Used in VB .NET
Using Select Case in VB.net
For Loop in VB.net
How To Connect To A MySql Database in VB.net
Stack data structure in VB.net
String.Contains (), compare, clone in VB.net
String Split function in VB.net
Create an Excel 2007 file in VB.NET 2005