Runtime Vs Compile time Errors in C#

The difference between compile time and run time is an example of what pointy-headed theorists call thephase distinction. It is one of the hardest concepts to learn, especially for people without much background in programming languages. To approach this problem, I find it helpful to ask What invariants does the program satisfy? What can go […]

Covariance and Contravariance FAQ

What are covariance and contravariance? In C#, covariance and contravariance enable implicit reference conversion for array types, delegate types, and generic type arguments.Covariance preserves assignment compatibility and contravariance reverses it. The following code demonstrates the difference between assignment compatibility, covariance, and contravariance. // Assignment compatibility. string str = “test”; // An object of a more […]

C# Programming Tools

The C# Team has scoured the Web for other implementations of the CLI, cool object browsers, IDE tricks, add-ins, obfuscators, and other useful tools and utilities that will help you get your job done faster. Check out the Classes and Libraries page for more links to useful tools, frameworks, and class libraries, including code-generation tools. Featured […]

Visual C# 2010 Samples

The Visual Studio 2010 RTM Samples are now live! Samples and documents for C# 4.0 can be found on the Downloads page. The CSharpDynamic samples include several projects showing how to use Dynamic with Office, IronPython and other technologies. There is also a covariance and contravariance example, and an example show how to use the new […]

Get Ready For C# 4.0!

Visual Studio 2010 is here! And of course this means that C# 4.0 is also here. Let’s do a quick review of the new language features added in this release. Dynamic The dynamic keyword is a key feature of this release. It closes the gap between dynamic and statically-typed languages. Now you can create dynamic […]