Thursday, September 22, 2011

Core .NET Types Usable from a Metro Style Application

When you create a new .NET Metro style application in Visual Studio, it spits out a project template that doesn't reference any .NET assemblies. Well, this isn't completely true, because when you run the C# compiler it references MSCorLib.dll by default. For a Metro style application, the referenced MSCorLib.dll contains a bunch of TypeForwardedToAttribute attributes (http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.typeforwardedtoattribute.aspx). This means that it exposes a bunch of types that you can use from your Metro style application that are actually implemented in various other assemblies. I wrote a small tool that reflects over this MSCorLib.dll are shows all of the core .NET types. The output of the tool is shown below. I grouped types by namespace and under each namespace I show the name of the type and the name of the assembly that defines the type in square brackets. Any type with a back tick in it (like Action`1) represents a generic type.

System

Action [System.Runtime]
Action`1 [System.Runtime]
Action`2 [System.Runtime]
Action`3 [System.Runtime]
Action`4 [System.Runtime]
Action`5 [System.Runtime]
Action`6 [System.Runtime]
Action`7 [System.Runtime]
Action`8 [System.Runtime]
Activator [System.Runtime]
AggregateException [System.Threading.Tasks]
ArgumentException [System.Runtime]
ArgumentNullException [System.Runtime]
ArgumentOutOfRangeException [System.Runtime]
ArithmeticException [System.Runtime]
Array [System.Runtime]
ArraySegment`1 [System.Runtime]
ArrayTypeMismatchException [System.Runtime]
AsyncCallback [System.Runtime]
Attribute [System.Runtime]
AttributeTargets [System.Runtime]
AttributeUsageAttribute [System.Runtime]

(more...)


Read more: Jeffrey Richter's Blog
QR: core-net-types-usable-from-a-metro-style-application.aspx

Posted via email from Jasper-Net