1. What is the .NET Framework?
.NET is a general-purpose software development platform, similar to Java. At its core is a virtual machine that turns intermediate language (IL) into machine code. High-level language compilers for C#, VB.NET and C++ are provided to turn source code into IL. An extensive class library is included, featuring all the functionality one might expect from a contempory development platform - windows GUI development (Windows Forms), database access (ADO.NET), web development (ASP.NET), web services, XML etc.
2. Explain why tracing helps with exception handling.
Tracing allows you to record unusual events while your application is running, without users being aware of it. If an unanticipated exception occurs, your application can write a message to the trace log, which helps you diagnose problems during testing and after deployment.
3. What is the common language runtime (CLR)?
The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. These features are intrinsic to the managed code that runs on the common language runtime.
The runtime also accelerates developer productivity
The runtime is designed to enhance performance
The runtime can be hosted by high-performance, server-side applications, such as Microsoft® SQL Server™ and Internet Information Services (IIS).
4. What is the Microsoft Intermediate Language (MSIL)?
IL = Intermediate Language. Also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code (of any language) is compiled to IL during development. The IL is then converted to machine code at the point where the software is installed, or (more commonly) at run-time by a Just-In-Time (JIT) compiler. MSIL allows for true cross-language integration.
5. How do assemblies find each other?
By searching directory paths. There are several factors, which can affect the path (such as the AppDomain host, and application configuration files), but for private assemblies the search path is normally the application's directory and its sub-directories. For shared assemblies, the search path is normally same as the private assembly path plus the shared assembly cache.
6. What are private assemblies and shared assemblies?
Location and visibility: 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. the .NET framework classes.
Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.
7. How can I produce an assembly?
The simplest way to produce an assembly is directly from a .NET compiler. You can then view the contents of the assembly by running the "IL Disassembler" tool that comes with the .NET SDK.
Alternatively you can compile your source into modules, and then combine the modules into an assembly using the assembly linker (al.exe). For the C# compiler, the /target: module switch is used to generate a module instead of an assembly.
8. What is managed code and managed data?
Managed code: The .NET framework provides several core run-time services to the programs that run within it - for example exception handling and security. For these services to work, the code must provide a minimum level of information to the runtime. Such code is called managed code.
Managed data: This is data that is allocated and freed by the .NET runtime's garbage collector.
Managed code is code that is written to target the services of the common language runtime. In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data—data that is allocated and de-allocated by the common language runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class.
9. How does assembly versioning work?
Each assembly has a version number called the compatibility version. Also each reference to an assembly (from another assembly) includes both the name and version of the referenced assembly.
The version number has four numeric parts (e.g. 5.5.2.33). Assemblies with either of the first two parts different are normally viewed as incompatible. If the first two parts are the same, but the third is different, the assemblies are deemed as 'maybe compatible'. If only the fourth part is different, the assemblies are deemed compatible. However, this is just the default guideline - it is the version policy that decides to what extent these rules are enforced. The version policy can be specified via the application configuration file.
Remember: versioning is only applied to shared assemblies, not private assemblies.
10. What is garbage collection?
Garbage collection is a mechanism that allows the computer to detect when an object can no longer be accessed. It then automatically releases the memory used by that object (as well as calling a clean-up routine, called a "finalizer," which is written by the user). Some garbage collectors like the one used by .NET, compact memory and therefore decrease your program's working set.
11. What operating systems does the .NET Framework run on?
The runtime supports Windows Server 2003, Windows XP, Windows 2000, NT4 SP6a and Windows ME/98. Windows 95 is not supported. Some parts of the framework do not work on all platforms - for example, ASP.NET is only supported on XP and Windows 2000/2003. Windows 98/ME cannot be used for development.
IIS is not supported on Windows XP Home Edition, and so cannot be used to host ASP.NET. However, the ASP.NET Web Matrix web server does run on XP Home. The .NET Compact Framework is a version of the .NET Framework for mobile devices, running Windows CE or Windows Mobile.
12. What is Namespace?
It gives you a way to organize your classes, so that related classes are bound together in a namespace.
It helps in large applications where different classes may be provided by different people, different teams, or even different organizations. Avoiding name clashes in large applications can be quite a headache, and in the past, developers have resorted to arcane naming conventions to ensure uniqueness for their class names.
13. Explain why exception handling is important to a completed application.
When an unhandled exception occurs in an application, the application stops—the user can't proceed, and any work he or she did immediately prior to the exception is lost. Exception handling provides a way to intercept and correct unusual occurrences that would otherwise cause these problems.
14. Describe the purpose of error pages and why they are needed.
Because Web applications run over the Internet, some exceptions occur outside the scope of the application. This means that your application can't respond directly to these exceptions. These types of exceptions are identified by HTTP response codes, which IIS can respond to by displaying custom error pages listed in your application's Web.config file.
15. Explain why tracing helps with exception handling.
Tracing allows you to record unusual events while your application is running, without users being aware of it. If an unanticipated exception occurs, your application can write a message to the trace log, which helps you diagnose problems during testing and after deployment.
16. What is a Repeater control?
Repeater control is a data-bound list control that allows custom layout by repeating a specified template for each item displayed in the list. It does not have built-in layout or styles, developers are required to explicitly declare HTML layout, formatting and style tags within the control's templates.
Shape Yahoo! in your own image. Join our Network Research Panel today!
No comments:
Post a Comment