0% found this document useful (0 votes)
62 views

STEPS OF VB DOT NET - Swas

The document summarizes the steps involved in .NET application development: 1. Application code is written using a .NET compatible language like VB and compiled into MSIL, which is stored in an assembly. 2. The MSIL is compiled using a JIT compiler into native code when executed. 3. The native code runs within the context of the .NET Common Language Runtime along with other applications and processes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

STEPS OF VB DOT NET - Swas

The document summarizes the steps involved in .NET application development: 1. Application code is written using a .NET compatible language like VB and compiled into MSIL, which is stored in an assembly. 2. The MSIL is compiled using a JIT compiler into native code when executed. 3. The native code runs within the context of the .NET Common Language Runtime along with other applications and processes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Summarize the steps

1. Application code is written using a .NET - compatible language such as


VB (see Figure 1 - 1).

VB CODE Figure 1-1

2. That code is compiled into MSIL, which is stored in an assembly (see


Figure 1 - 2).

VB
APPLICATION ASSEMBLEY
CODE COMPILATION
CODE

Figure 1-2

3. When this code is executed (either in its own right if it is an executable


or when it is used from other code), it must first be compiled into native
code using a JIT compiler (see Figure 1 - 3).

ASSEMBLEY JIT NATIVE


COMPILATION CODE

Figure 1-3

4. the native code is executed in the context of the managed CLR, along
with any other running applications or processes, as shown in Figure 1 - 4.

System Runtime

.NET CLR

NATIVE NATIVE NATIVE


CODE CODE CODE

Figure 1-4
Applications You Can Write with VB

The .NET Framework has no restrictions on the types of applications that are
possible, as discussed earlier. VB uses the framework and therefore has no
restrictions on possible applications. However, here are a few of the more
common application types:

Windows applications: These are applications, such as Microsoft Office, that


have a familiar Windows look and feel about them. This is made simple by using
the Windows Forms module of the .NET Framework, which is a library of controls
(such as buttons, toolbars, menus, and so on) that you can use to build a
Windows user interface (UI).

Web applications: These are Web pages such as might be viewed through any
Web browser. The .NET Framework includes a powerful system for generating
Web content dynamically, allowing personalization, security, and much more.
This system is called ASP.NET (Active Server Pages .NET), and you can use VB
to create ASP.NET applications using Web Forms.

Web services: These are a new and exciting way to create versatile distributed
applications. Using Web services you can exchange virtually any data over the
Internet, using the same simple syntax regardless of the language used to create
a Web service or the system that it resides on.

.NET Framework 3.5 New Features

Faster .NET Framework execution


1. Faster garbage collection
*
2. Smarter, faster NGen requiring smaller working set RAM
3. 64 bit client improvements
4. Thread Pool performance improvements
5. Security checks caching during NGen.

Base Class Library – New Class Additions


6. BigInteger, HashSet and DateTime2 types
7. NSA Suite”B” and FIPs compliant cryptography
8. Lightweight Reader/Writer Lock Classes
9. Anonymous and Named Pipes IO Classes
10. Integration with Event Tracing for Windows
11. New Adding hosting model for extensibility

* NGen:-Native Image Generator


FRAMEWORK OF DOT NET

 What is an IL?

(IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or


CIL (Common Intermediate Language). All .NET source code is compiled to IL. This IL is
then converted to machine code at the point where the software is installed, or at run-
time by a Just-In- Time (JIT) compiler.

 What is a CLR?

Full form of CLR is Common Language Runtime and it forms the heart of the .NET
framework. All Languages have runtime and its the responsibility of the runtime to take
care of the code execution of the program. For example VC++ has MSCRT40.DLL,VB6
has MSVBVM60.DLL,Java has Java Virtual Machine etc. Similarly .NET has CLR.
Following are the responsibilities of CLR

 Garbage Collection: - CLR automatically manages memory thus eliminating


memory leaks. When objects are not referred GC automatically releases those
memories thus providing efficient memory management.
 Code Access Security: - CAS grants rights to program depending on the
security configuration of the machine. Example the program has rights to edit or
create a new file but the security configuration of machine does not allow the
program to delete a file. CAS will take care that the code runs under the
environment of machines security configuration.
 Code Verification: - This ensures proper code execution and type safety while
the code runs. It prevents the source code to perform illegal operation such as
accessing invalid memory locations etc.
 IL( Intermediate language )-to-native translators and optimizer’s :- CLR uses
JIT and compiles the IL code to machine code and then executes. CLR also determines
depending on platform what is optimized way of running the IL code.

 What is a CTS?

In order that two language communicate smoothly CLR has CTS (Common Type
System).Example in VB you have “Integer” and in C++ you have “long” these data types
are not compatible so the interfacing between them is very complicated. In order to able
that two different languages can communicate Microsoft introduced Common Type
System. So “Integer” data type in VB6 and “int” data type in C++ will convert it to
System.int32 which is data type of CTS. CLS which is covered in the coming question is
subset of CTS.

 What is a CLS (Common Language Specification)?

This is a subset of the CTS which all .NET languages are expected to support. It was
always a dream of Microsoft to unite all different languages in to one umbrella and CLS
is one step towards that. Microsoft has defined CLS which are nothing but guidelines
that language to follow so that it can communicate with other .NET languages in a
seamless manner.

 What is a Managed Code?

Managed code runs inside the environment of CLR i.e. .NET runtime. In short all IL are
managed code. But if you are using some third party software example VB6 or VC++
component they are unmanaged code as .NET runtime (CLR) does not have control
over the source code execution of the language.

 What is an Assembly?

 Assembly is unit of deployment like EXE or a DLL.

 An assembly consists of one or more files (dlls, exe’s, html files etc.), and
represents a group of resources, type definitions, and implementations of those
types. An assembly may also contain references to other assemblies. These
resources, types and references are described in a block of data called a manifest.
The manifest is part of the assembly, thus making the assembly self-describing.

 What are the different types of Assembly?

There are two types of assembly Private and Public assembly. A private assembly is
normally used by a single application, and is stored in the application's directory, or a
sub-directory beneath. A shared assembly is normally stored in the global assembly
cache, which is a repository of assemblies maintained by the .NET runtime. Shared
assemblies are usually libraries of code which many applications will find useful, e.g.
Crystal report classes which will be used by all application for Reports.

 What is garbage collection?

Garbage collection is a CLR feature which automatically manages memory.


Programmers forget to release the objects while coding..... Laziness (Remember in VB6
where one of the good practices is to set object to nothing). CLR automatically releases
objects when they are no longer in use and referenced. CLR runs on non-deterministic
to see the unused objects and cleans them. One side effect of this non-deterministic
feature is that we cannot assume an object is destroyed when it goes out of the scope of
a function. Therefore, we should not put code into a class destructor to release
resources.

What is the difference between VB.NET and C#?

Well this is the most debatable issue in .NET community and people treat
there languages like
religion. Its a subjective matter which language is best. Some like VB.NET’s
natural style and some
like professional and terse C# syntaxes. Both use the same framework and
speed is also very much
equivalents. But still let’s list down some major differences between them :-

Advantages VB.NET :-

 Has support for optional parameters which makes COM interoperability much easy.
 With Option Strict off late binding is supported.Legacy VB functionalities can be
used by using Microsoft.VisualBasic namespace.
 Has the WITH construct which is not in C#.
 The VB.NET part of Visual Studio .NET compiles your code in the background.
While this is considered an advantage for small projects, people creating very large
projects have found that the IDE slows down considerably as the project gets larger.

Advantages of C#

 XML documentation is generated from source code but this is now been incorporated
in Whidbey.
 Operator overloading which is not in current VB.NET but is been introduced in
Whidbey.
 Use of this statement makes unmanaged resource disposal simple.
 Access to Unsafe code. This allows pointer arithmetic etc, and can improve
performance in some situations. However, it is not to be used lightly, as a lot of the
normal safety of C# is lost (as the name implies).This is the major difference that you
can access unmanaged code in C# and not in VB.NET.

You might also like