1. What is .NET Framework?
The .NET framework created by Microsoft is a software development platform focused
on rapid application development, platform independence and network transparency.
.NET is Microsoft's strategic initiative for server and desktop development for the next
decade. According to Microsoft, .NET includes many technologies that are designed to
facilitate rapid development of Internet and intranet applications.
2. Is .NET a runtime service or a development platform?
It's both and actually a lot more. Microsoft .NET includes a new way of delivering
software and services to businesses and consumers. A part of Microsoft.NET is the .NET
Frameworks. The .NET frameworks SDK consists of two parts: the .NET common
language runtime and the .NET class library. In addition, the SDK also includes
command-line compilers for C#, C++, JScript, and VB. You use these compilers to build
applications and components. These components require the runtime to execute so this is
a development platform.
3.What is a IL? or what is MSIL?What is JIT?
(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.
4. Can we write IL programs directly?
Yes.
assembly
MyAssembly {
}
.class MyApp {
.method static void Main() {
.entrypoint ldstr "Hello, IL!" call
void System.Console::WriteLine(class System.Object)
ret }
}
Just put this into a file called hello.il, and then run ilasm hello.il. An exe assembly will be
generated.Can I do things in IL that I can't do in C#?Yes. A couple of simple examples
are that you can throw exceptions that are not derived from System.Exception, and you
can have non-zero-based arrays.
5.What is JIT (just in time)?
how it works?Before Microsoft intermediate language (MSIL) can be executed, it must
be converted by a .NET Framework just-in-time (JIT) compiler to native code, which is
CPU-specific code that runs on the same computer architecture as the JIT compiler.
Rather than using time and memory to convert all the MSIL in a portable executable (PE)
file to native code, it converts the MSIL as it is needed during execution and stores the
resulting native code so that it is accessible for subsequent calls.The runtime supplies
another mode of compilation called install-time code generation. The install-time code
generation mode converts MSIL to native code just as the regular JIT compiler does, but
it converts larger units of code at a time, storing the resulting native code for use when
the assembly is subsequently loaded and executed.As part of compiling MSIL to native
code, code must pass a verification process unless an administrator has established a
security policy that allows code to bypass verification. Verification examines MSIL and
metadata to find out whether the code can be determined to be type safe, which means
that it is known to access only the memory locations it is authorized to access.
6. What is strong name?
A name that consists of an assembly's identity—its simple text name, version number,
and culture information (if provided)—strengthened by a public key and a digital
signature generated over the assembly.
7. What is portable executable (PE)?
The file format defining the structure that all executable files (EXE) and Dynamic Link
Libraries (DLL) must use to allow them to be loaded and executed by Windows. PE is
derived from the Microsoft Common Object File Format (COFF). The EXE and DLL
files created using the .NET Framework obey the PE/COFF formats and also add
additional header and data sections to the files that are only used by the CLR. The
specification for the PE/COFF file formats is available at
http://www.microsoft.com/whdc/hwdev/hardware/pecoffdown.mspx
8.What is Event - Delegate?
The event keyword lets you specify a delegate that will be called upon the occurrence of
some "event" in your code. The delegate can have one or more associated methods that
will be called when your code indicates that the event has occurred. An event in one
program can be made available to other programs that target the .NET Framework
Common Language Runtime.// keyword_delegate.cs// delegate declarationdelegate void
MyDelegate(int i);class Program
{
public static void Main()
{
TakesADelegate(new MyDelegate(DelegateFunction));
}
public static void TakesADelegate(MyDelegate SomeFunction)
{
SomeFunction(21);
}
public static void DelegateFunction(int i)
{
System.Console.WriteLine("Called by delegate with number: {0}.", i);
}
}
No comments:
Post a Comment