Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all platforms supported by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework, .NET Compact Framework and Microsoft Silver light. Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every level²including adding support for sourcecontrol systems and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle. Visual Studio supports different programming languages by means of language services, which allow the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. Built-in languages include C/C++ (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual Studio 2010) Support for other languages such as M, Python, and Ruby among others is available via language services installed separately. It also supports XML/XSLT, HTML/XHTML, JavaScript and CSS. Individual language-specific versions of Visual Studio also exist which provide more limited language services to the user: Microsoft Visual Basic, Visual J#, Visual C#, and Visual C++. Microsoft provides "Express" editions of its Visual Studio 2010 components Visual Basic, Visual C#, Visual C++, and Visual Web Developer at no cost. Visual Studio 2010, 2008 and 2005 Professional Editions, along with language-specific versions (Visual Basic, C++, C#, J#) of Visual Studio 2005 are available for free to students as downloads via Microsoft's Dream Spark program. The 90-day trial version of Visual Studio can be downloaded by the general public at no cost.


The code editor supports code snippets. Background compilation does not generate executable code. Background compilation was initially introduced with Microsoft Visual Basic but has now been expanded for all included languages.IntelliSense is supported for the included languages. The Visual Studio code editor also supports setting bookmarks in code for quick navigation. among others. overlaid on top of the code editor. it can be made temporarily semi-transparent to see the code obstructed by it. Other navigational aids include collapsing code blocks and incremental search. In addition. The code editor is used for all supported languages. The . since it requires a different compiler than the one used to generate executable code. Multi-threaded programs are also supported. If source code is not available. The Visual Studio code editor also supports code refactoring including parameter reordering. includes a code editor that supports syntax highlighting and code completion using IntelliSense for not only variables. Auto complete suggestions are popped up in a modeless list box.Code editor Visual Studio. as well as for XML and for Cascading Style Sheets and JavaScript when developing web sites and web applications. These tools are surfaced as floating windows which can be set to automatically hide when unused or docked to the side of the screen. In Visual Studio 2008 onwards. The Visual Studio debugger can also create memory dumps as well as load them later for debugging. Visual Studio features background compilation (also called incremental compilation). it can also attach to running processes and monitor and debug those processes. which are saved templates for repetitive code and can be inserted into code and customized for the project being worked on. Debugger Visual Studio includes a debugger that works both as a source-level debugger and as a machine-level debugger. As code is being written. interface extraction and encapsulation of class members inside properties. variable and method renaming. in addition to normal text search and regex search. Visual Studio compiles it in the background in order to provide feedback about syntax and compilation errors. Warnings are marked with a green underline. which are flagged with a red wavy underline. it displays the code as it is being run. It works with both managed code as well as native code and can be used for debugging applications written in any language supported by Visual Studio. like any other IDE. A management tool for code snippets is built in as well. The code editor also includes a multi-item clipboard and a task list. functions and methods but also language constructs like loops and queries. it can show the disassembly. If source code for the running process is available.

NET Framework The . memory management. its current value is displayed in a tooltip ("data tooltips"). During coding.e. When debugging. Breakpoints can be conditional. The debugger allows setting breakpoints (which allow execution to be stopped temporarily at a certain position) and watches (which monitor the values of variables as the execution progresses).. the execution of the function body isn't available for manual inspection. The class library is used by programmers. the Visual Studio debugger lets certain functions be invoked manually from the immediate tool window.e. not supported in 64 bit). It can either step into functions to debug inside it. The . it allows code to be edited as it is being debugged (32 bit only. and exception handling. The parameters to the method are supplied at the immediate window. meaning they get triggered when the condition is met.e. The CLR is an application virtual machine so that programmers need not consider the capabilities of the specific CPU that will execute the program.NET Framework execute in a software (as contrasted to hardware) environment. .NET library is available to all the programming languages that . The debugger supports Edit and Continue. Programs written for the . numeric algorithms.. if the mouse pointer hovers over any variable.NET Framework. The CLR also provides other important services such as security. who combine it with their own code to produce applications. The framework's Base Class Library provides user interface.. and network communications. Code can be stepped over. It includes a large library. i. or step over it.NET supports. database connectivity. data access. cryptography. and it supports several programming languages which allows language interoperability (each language can use code written in other languages).NET Framework is a software framework for Microsoft Windows operating systems. where it can also be modified if desired. run one line (of source code) at a time.debugger can be configured to be launched when an application running outside the Visual Studio environment crashes. The class library and the CLR together constitute the . i. web application development. i. known as the Common Language Runtime (CLR). .

NET programs execute under the supervision of the CLR.NET Framework is intended to be used by most new applications created for the Windows platform.NET Framework supports the exchange of types and object instances between libraries and applications written using any conforming .NET Framework. the . the . . part of the Framework Class Library (FCL). is a library of functionality available to all languages using the .NET Framework 4 (or newer) or Visual Studio 2010. Language Independence The . The BCL provides classes which encapsulate a number of common functions. database interaction. Base Class Library The Base Class Library (BCL). software developers must also install Microsoft's SDK for Windows 7 or .NET Framework provides means to access functionality that is implemented in programs that execute outside the . graphic rendering. security. Because of this feature. All . XML document manipulation and so on. Principal design features Interoperability Because computer systems commonly require interaction between new and older applications.Runtime. or CTS. To develop new applications.InteropServices and System. guaranteeing certain properties and behaviors in the areas of memory management. Common Language Runtime Engine The Common Language Runtime (CLR) is the execution engine of the . including file reading and writing.NET environment.NET Framework.NET Framework introduces a Common Type System. The CTS specification defines all possible data types and programming constructs supported by the CLR and how they may or may not interact with each other conforming to the Common Language Infrastructure (CLI) specification. access to other functionality is provided using the P/Invoke feature. and exception handling.EnterpriseServices namespaces of the framework. Access to COM components is provided in the System.NET language.The .

security. and that it conforms to security requirements. Microsoft's implementation of the CLI is . that have been exploited by malicious software. and interoperability. such as buffer overflows. Additionally. Security The design is meant to address some of the vulnerabilities. a program written to use the framework should run without change on any type of system for which the framework is implemented. and the C++/CLI language to both ECMA and the ISO. Garbage Collection.Simplified Deployment The . That is. the framework is engineered to be platform agnostic. Portability The design of the . While Microsoft has never implemented the full framework on any system except Microsoft Windows. . Architecture Common Language Infrastructure (CLI) The purpose of the Common Language Infrastructure is to provide a language-neutral platform for application development and execution. By implementing the core aspects of the . This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms. this functionality will not be tied to a single language but will be available across the many languages supported by the framework. and the Common Intermediate Language) the C# language. Common Type System. including functions for Exception handling. and thus cross-platform compatible.NET Framework includes design features and tools that help manage the installation of computer software to ensure that it does not interfere with previously installed software.NET Framework allows it theoretically to be platform agnostic. and cross-platform implementations are available for other operating systems Microsoft submitted the specifications for the Common Language Infrastructure (which includes the core class libraries.NET Framework within the scope of the CLI. making them available as open standards.NET provides a common security model for all applications.

assemblies are stored in the Portable Executable (PE) format.NET metadata. The complete name of an assembly (not to be confused with the filename on disk) contains its simple text name. As mandated by specification. The assembly consists of one or more files. When an assembly is loaded the CLR performs various tests. Metadata All CIL is self-describing through . Code Access Security uses evidence to determine the permissions granted to the code.called the Common Language Runtime or CLR. and validation and verification.NET Framework. Assemblies The CIL code is housed in . common on the Windows platform for all DLL and EXE files. if any assembly is not granted the permission a security exception is thrown. version number. Metadata is usually generated by language compilers but developers can create their own metadata through custom attributes. Security . one of which must contain the manifest. Metadata contains information about the assembly. The CLR checks the metadata to ensure that the correct method is called. A private key can also be specified known only to the creator of the assembly and can be used for strong naming and to guarantee that the assembly is from the same author when a new version of the assembly is compiled (required to add an assembly to the Global Assembly Cache). thus two assemblies with the same public key token are guaranteed to be identical from the point of view of the framework. Two such tests are validation and verification. The demand causes the CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission. During validation the CLR checks that . culture.NET assemblies.NET has its own security mechanism with two general features: Code Access Security (CAS). Typically the evidence is the source of the assembly (whether it is installed on the local machine or has been downloaded from the intranet or Internet). and public key token. which has the metadata for the assembly. Other code can demand that calling code is granted a specified permission. Code Access Security is based on evidence that is associated with a specific assembly. and is also used to implement the reflective programming capabilities of . The public key token is a unique hash generated when the assembly is compiled.

database interaction. ASP. The . has to split the application into sub domains. These class libraries implement a large number of common functions. hence occasionally code that is 'safe' does not pass. Application Domains can be created and code can be loaded into or unloaded from them independent of other Application Domains. Unsafe code will only be executed if the assembly has the 'skip verification' permission.NET Framework as well as its alternative implementations including .NET. The verification mechanism checks to see if the code does anything that is 'unsafe'.NET. The algorithm used is quite conservative.dll and System. Windows Communication Foundation among others. The . The class library is organized in a hierarchy of namespaces.* namespaces. The Framework Class Library (FCL) is a superset of the BCL classes and refers to the entire class library that ship with . The FCL is much larger in scope than standard libraries for languages like C++. it is not done by the CLR. Application Domains can also be configured independently with different security privileges.NET class libraries are available to all CLI compliant languages. ADO. Most of the built in APIs are part of either System. however.NET Framework includes a set of standard class libraries. This can help increase the security of the application by isolating potentially unsafe code.the assembly contains valid metadata and CIL. and XML document manipulation.* or Microsoft.NET Framework. as faults or crashes in one Application Domain do not affect the rest of the application. It includes an expanded set of libraries.NET Framework class library is divided into two parts: the Base Class Library and the Framework Class Library. including Windows Forms.NET Framework uses Application Domains as a mechanism for isolating code running in a process. such as file reading and writing. The Base Class Library (BCL) includes a small subset of the entire class library and is the core set of classes that serve as the basic API of the Common Language Runtime. Memory management . among others.dll are considered to be a part of the BCL. graphic rendering. Microsoft Silver light and Mono. Windows Presentation Foundation. This helps increase the fault tolerance of the application. and comparable in scope to the standard libraries of Java. The BCL classes are available in both . Language Integrated Query. which generally means code that is installed on the local machine. Class library The . The classes in mscorlib.dll and some of the classes in System. and whether the internal tables are correct.core. . The developer.NET Compact Framework. Verification is not so exact.

newly created objects belong to Generation 0.NET Framework is actually generational. and then recursively walk them. unless an explicit double-call is issued. which might be either a direct reference to an object or via a graph of objects. Since the memory held by garbage is not of any consequence. However. .NET Framework includes a garbage collector which runs periodically. However.NET metadata and reflection to discover the objects encapsulated by an object. markand-sweep garbage collector. a pool of memory managed by the CLR. the object is considered to be in use by the CLR. . The objects that survive a garbage collection are tagged as Generation 1. as well as objects referred to by CPU registers. instead it does the memory management itself even though there are no actual guarantees as to when the Garbage Collector will perform its work. on a separate thread from the application's thread. It uses . It then enumerates all the objects on the heap (which were initially allocated contiguously) using reflection. The objects are then compacted together to make used memory contiguous again. When the GC runs. As long as there exists a reference to an object.The . The GC used by . compacting. The . The . When there is no reference to an object. and it cannot be reached or used.NET types (objects) is done contiguously from the managed heap. Any reference to an object invalidated by moving the object is updated to reflect the new location by the GC. Since it is not guaranteed when the conditions to reclaim memory are reached. The application is resumed after the garbage collection is over. This helps increase the efficiency of garbage collection. This is the mark phase. it becomes garbage. The GC runs only when a certain amount of memory has been used or there is enough pressure for memory on the system. it recursively enumerates all the objects reachable from the root objects and marks them as reachable. it is considered free space.NET application has a set of roots.NET Garbage Collector (GC) is a non-deterministic. Higher generation objects are garbage collected less frequently than lower generation objects. These include references to static objects and objects defined as local variables or method parameters currently in scope.NET Framework CLR frees the developer from the burden of managing memory (allocating and freeing up when done). the memory allocated to instantiations of . To this end. it still holds on to the memory allocated to it. and the Generation 1 objects that survive another collection are Generation 2 objects. Objects are assigned a generation. that enumerates all the unusable objects and reclaims the memory allocated to them. All objects not marked as reachable are garbage. the GC runs are non-deterministic.NET Framework uses up to Generation 2 objects. Each . and for each object referred to in the root. which are pointers to objects on the managed heap (managed objects). it pauses the application. this leaves chunks of free space between objects which were initially contiguous.

vb or . . dynamic code which runs on the server can be placed in a page within a block <% older objects tend to have a larger lifetime than newer objects. are the main building block for application development.aspx page. and is the successor to Microsoft's Active Server Pages (ASP) technology. With ASP. Additionally.NET is built on the Common Language Runtime (CLR).NET Framework 2.0 of the . web applications and web services.0. Characteristics Pages ASP.aspx" extension.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites.NET SOAP extension framework allows ASP. and ASP. which is similar to other web development technologies such as PHP.aspx. while dynamic code remains in an .%>. ASP.NET components to process SOAP messages.cs file (depending on the programming language used). as well as markup defining server-side Web Controls and User Controls where the developers place all the required static and dynamic content for the web page. known officially as "web forms".NET code using any supported .NET language. Web forms are contained in files with an ". by removing older (and thus more likely to survive a collection) objects from the scope of a collection run. these files typically contain static (X)HTML markup.aspx.dynamic code -.NET web pages. JSP. The ASP.NET ASP. allowing programmers to write ASP. fewer objects need to be checked and compacted. Thus. It was first released in January 2002 with version 1.NET Framework. ASP. Microsoft introduced a new code-behind model which allows static text to remain on the .

Custom controls Programmers can also build custom controls for ASP. These files usually contain static HTML markup. An event bubbling mechanism provides the ability to pass an event fired by a user control up to its containing page. This is similar to the separation of the controller from the view in Model±View±Controller (MVC) frameworks. a user control cannot be requested independently. or a control being clicked.Code-behind model Microsoft recommends dealing with dynamic program code by using the code-behind model. User controls have their own events which are handled during the life of ASP.NET page. like the page being loaded. rather than a procedural walk through of the document.aspx. ASP. A user control is compiled when its containing page is requested and is stored in memory for subsequent requests. for example. having all their code compiled into a dynamic link library (DLL) file. this would allow a web designer.cs or MyPage. Such custom controls can be used across multiple web applications and Visual Studio . Unlike user controls. to focus on the design markup with less potential for disturbing the programming code that drives it. Unlike an ASP.NET. When using this style of programming. In theory. as well as markup defining server-side web controls. Code-behind files typically have names like MyPage.aspx. These are the locations where the developer can place the required static and dynamic content. the developer writes code to respond to different events.NET's code-behind model marks a departure from Classic ASP in that it encourages developers to build applications with separation of presentation and content in mind. User controls User controls are encapsulations of sections of pages which are registered and used as controls in ASP.aspx (same filename as the page file (ASPX). one of its containing pages is requested instead.NET requests.vb while the page file is MyPage. these controls don't have an ASCX markup file. This practice is automatic in Microsoft Visual Studio and other IDEs. but with the final extension denoting the page language). User controls are created as ASCX markup files. which places this code in a separate file or in a specially designated script tag.NET applications.

general-purpose. require an expression of a type that implements the true operator. C# disallows this "integer meaning true or false" approach on the grounds that forcing programmers to use expressions that return exactly bool can prevent certain types of common programming mistakes in C or C++ such as if (a = b) (use of assignment = instead of equality ==). array. While C++ also has a Boolean type. C# supports a strict Boolean data type.project. Some notable distinguishing features of C# are: y y There are no global variables or functions. unlike C and C++. which always either point to a "live" object or have the well-defined null value. generic. Code that is not marked . object-oriented (class-based). and programs with unsafe code need appropriate permissions to run. and component-oriented programming disciplines. Static members of public classes can substitute for global variables and functions. object-oriented programming language. functional. C# is one of the programming languages designed for the Common Language Infrastructure. or a block of memory allocated on a stack. string. An unsafe pointer can point to an instance of a value-type. declarative. bool. All methods and members must be declared within classes. Statements that take conditions. modern. allowing a to be an int. Most object access is done through safe object references. it is impossible to obtain a reference to a "dead" object (one which has been garbage collected). C# is intended to be a simple. In C#. such as while and if. It was developed by Microsoft within the .NET initiative and later approved as a standard by Emma (ECMA-334) and ISO (ISO/IEC 23270). Local variables cannot shadow variables of the enclosing block. C# C# is a multi-paradigm programming language encompassing imperative. memory address pointers can only be used within blocks specifically marked as unsafe. Variable shadowing is often considered confusing by C++ texts. it can be freely converted to and from integers. such as the Boolean type. or a pointer. or to a random block of memory. and expressions such as if(a) require only that a is convertible to bool.

C# provides properties as syntactic sugar for a common pattern in which a pair of methods. Managed memory cannot be explicitly freed. Multiple inheritance is not supported. There are no implicit conversions between Booleans and integers. nor between enumeration members and integers (except for literal 0. but it cannot dereference them.0) has 77 reserved words. at runtime. C# currently (as of version 4. Any user-defined conversion must be explicitly marked as explicit or unsafe can still store and manipulate pointers through the System. . unlike C++ copy constructors and conversion operators. although a class can implement any number of interfaces...catch construct to handle exceptions. This is enforced at compile-time. C# is more type safe than C++. C# has a try. which can be implicitly converted to any enumerated type).finally construct to guarantee execution of the code in the finally block. Checked exceptions are not present in C# (in contrast to Java). This was a design decision by the language's lead architect to avoid complication and simplify architectural requirements throughout CLI. In addition to the try. Garbage collection addresses the problem of memory leaks by freeing the programmer of responsibility for releasing memory which is no longer needed.. it is automatically garbage collected. Full type reflection and discovery is available. and. in some cases. The only implicit conversions by default are those which are considered safe.. which are both implicit by default. such as widening of integers. during JIT. Enumeration members are placed in their own scope. instead. accessor (getter) and mutator (setter) encapsulate operations on a single attribute of a class.IntPtr type. This has been a conscious decision based on the issues of scalability and version ability.

Sign up to vote on this title
UsefulNot useful