What’s New in the Visual C# 2008

The C# 3.0 language and compiler introduce several new language features. These new language constructs are useful individually in various contexts, and collectively for doing Language-Integrated Query (LINQ).

The following table lists the new C# 3.0 language features:

Feature Description
Implicitly Typed Local Variables and Arrays When used with local variables, the var keyword instructs the compiler to infer the type of the variable or the array elements from the expression on the right side of the initialization statement.
Object Initializers Enables object initialization without explicit calls to a constructor.
Collection Initializers Enables initialization of collections with an initialization list rather than specific calls to Add or another method.
Extension Methods Extend existing classes by using static methods that can be invoked by using instance method syntax.
Anonymous Types Enables on-the-fly creation of unnamed structured types that can be added to collections and accessed by using var.
Lambda Expressions Enables inline expressions with input parameters that can be bound to delegates or expression trees.
Query Keywords Keywords that specify clauses in a query expression:

  • from clause(s)
  • where clause (optional)
  • ordering clauses (optional)
  • join clause (optional)
  • select or group clause
  • into clause (optional)
Auto-Implemented Properties Enables declaration of properties by using simplified syntax.
Partial Method Definitions Partial types may now contain partial methods.

Visual C# IDE

Feature Description
Multi-targeting Visual Studio 2008 enables you to specify a version of the .NET Framework for your project, .NET Framework 2.0, 3.0, or 3.5. The .NET Framework target of an application is the version of the .NET Framework that is required on a computer to enable the application to run on that computer.
New Project Types and Templates Several new project templates are provided for Windows Presentation Foundation, Windows Communication Foundation, and Web projects.
IntelliSense support for C# 3.0 The Visual C# code editor provides statement completion and Quick Info to support the following new language constructs in C# 3.0:

  • Implicitly Typed Local Variables
  • Query Expressions
  • Extension Methods
  • Object/Collection Initializers
  • Anonymous Types
  • Lambda Expressions
  • Partial Methods

For more information, see Visual C# IntelliSense.

Refactoring Support for C# 3.0 The refactoring features, Rename, Signature Change, Extract Method, and Promote Local have been updated to support the following new language constructs:

  • Query Expressions
  • Extension Methods
  • Lambda Expressions

In addition, refactoring provides new options and warnings to help prevent unintended consequences from a refactoring action.

Code Formatting The code editor supports formatting options for several new C# 3.0 language constructs including query expressions.
Organizing Using Statements The Visual C# code editor provides an easy way to sort using and extern declarations and remove those that are not being used.
Posted in CSharp. Tags: , . 1 Comment »

What’s New in the C# 2.0

With the release of Visual Studio 2005, the C# language has been updated to version 2.0, which supports the following new features:

Generics
Generic types are added to the language to enable programmers to achieve a high level of code reuse and enhanced performance for collection classes. Generic types can differ only by arity. Parameters can also be forced to be specific types. For more information, see Generic Type Parameters.
Iterators
Iterators make it easier to dictate how a foreach loop will iterate over a collection’s contents.
Partial Classes
Partial type definitions allow a single type, such as a class, to be split into multiple files. The Visual Studio designer uses this feature to separate its generated code from user code.
Nullable Types
Nullable types allow a variable to contain a value that is undefined. Nullable types are useful when working with databases and other data structures that may contain elements that contain no specific values.
Anonymous Methods
It is now possible to pass a block of code as a parameter. Anywhere a delegate is expected, a code block can be used instead: there is no need to define a new method.
Namespace alias qualifier
The namespace alias qualifier (::) provides more control over accessing namespace members. The global :: alias allows access the root namespace that may be hidden by an entity in your code.
Static Classes
Static classes are a safe and convenient way of declaring a class containing static methods that cannot be instantiated. In C# version 1.2 you would have defined the class constructor as private to prevent the class being instantiated.
External Assembly Alias
Reference different versions of the same component contained in the same assembly with this expanded use of the extern keyword.
Property Accessor Accessibility
It is now possible to define different levels of accessibility for the get and set accessors on properties.
Covariance and Contravariance in Delegates
The method passed to a delegate may now have greater flexibility in its return type and parameters.
How to: Declare, Instantiate, and Use a Delegate
Method group conversion provides a simplified syntax for declaring delegates.
Fixed Size Buffers
In an unsafe code block, it is now possible to declare fixed-size structures with embedded arrays.
Friend Assemblies
Assemblies can provide access to non-public types to other assemblies.
Inline warning control
The #pragma warning directive may be used to disable and enable certain compiler warnings.
volatile
The volatile keyword can now be applied to IntPtr and UIntPtr.

The C# compiler introduces the following additions and changes for this release:

/errorreport option
Can be used to report internal compiler errors to Microsoft over the Internet.
/incremental option
Has been removed.
/keycontainer and /keyfile options
Support specifying cryptographic keys.
/langversion option
Can be used to specify compatibility with a specific version of the language.
/linkresource option
Contains additional options.
/moduleassemblyname option
Allows you to build a .netmodule file and access non-public types in an existing assembly.
/pdb option
Specifies the name and location of the .pdb file.
/platform option
Enables you to target Itanium Family (IPF) and x64 architectures.
#pragma warning
Used to disable and enable individual warnings in code.

Source from MSDN Library

C# Developers Guides

1. Csharp bible

csharp bible

Click here to Download

2. Csharp_ebook

csharp_ebook

Click here to Download

3. Csharp web dev guide

csharp web dev guide

Click here to Download

4. CSharp 2.0 – Practical Guide For Programmers (2005)

CSharp 2.0 - Practical Guide For Programmers (2005)

Click here to Download

5. Pro C# 2008 and the NET 3.5 Platform Fourth Edition

pro

Click here to Download

6.O’Reilly – Programming C#

[EBOOK - EN] O'Reilly - Programming C#

Click here to Download

7. C# manual-MSDN-Microsoft-Com

m

Click here to Download

8. Apress – Accelerated C Sharp 2008

Apress - Accelerated C Sharp 2008

Click here to Download

9. CSharp 2005 For Dummies

CSharp 2005 For Dummies

Click here to Download

10. MSDN Training – Introduction to C# Programming for the Microsoft .NET Platform

msdn

Click here to Download

11. Data Structures and Algorithms with Object-Oriented Design Patterns in C#

Data Structures and Algorithms with Object-Oriented Design Patterns in C#

Click here to Download

12. C#_FAQ

C#

Click here to Download

.NET Framework Essentials by O’Reilly Media

Here is a cool document that i found about .NET Framework

How Does a C# Application Run?

An important point is that C# is a “managed” language, meaning that it requires the .NET Common Language Runtime (CLR) to execute. Essentially, as an application that is written in C# executes, the CLR is managing memory, performing garbage collection, handling exceptions, and providing many more services that you, as a developer, don’t have to write code for.

The C# compiler produces Intermediate Language (IL) , rather than machine language, and the CLR understands IL. When the CLR sees the IL, it Just-In-Time (JIT) compiles it, method by method, into compiled machine code in memory and executes it. As mentiond previously, the CLR manages the code as it executes.

Because C# requires the CLR, you must have the CLR installed on your system. All new Windows operating systems ship with a version of the CLR and it is available via Windows Update for older systems.

The CLR is part of the .NET, so if you see updates for the .NET Framework Runtime, it contains the CLR and .NET Framework Class Library (FCL). It follows that if you copy your C# application to another machine, then that machine must have the CLR installed too.

Posted in CSharp. Tags: . Leave a Comment »