Consider the following super simple C# code
namespace SmartDeviceProject1
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello");
}
}
}
Can you guess how many managed Type gets loaded to run this? I was doing some profiling the .NET Compact Framework loader (for entirely unrelated reason) and was surprised by the list that got dumped. 87 types**, never could've guessed that...
- System.Object
- System.ValueType
- System.Type
- System.Reflection.MemberInfo
- System.Delegate
- System.MarshalByRefObject
- System.SystemException
- System.Exception
- System.Attribute
- System.Collections.Hashtable
- System.Enum
- System.Reflection.BindingFlags
- System.MulticastDelegate
- System.Reflection.MemberFilter
- System.Reflection.Binder
- System.Reflection.TypeAttributes
- System.DateTime
- System.Collections.IDictionary
- System.UnhandledExceptionEventHandler
- System.AppDomainManager
- System.Version
- System.Decimal
- System.Runtime.InteropServices.ComInterfaceType
- System.Collections.ICollection
- System.Collections.IEqualityComparer
- System.AppDomainManagerInitializationOptions
- System.ArithmeticException
- System.ArgumentException
- System.MissingMemberException
- System.MemberAccessException
- System.AppDomainSetup
- System.Reflection.AssemblyName
- System.Globalization.CultureInfo
- System.Reflection.Assembly
- System.Configuration.Assemblies.AssemblyHashAlgorithm
- System.Configuration.Assemblies.AssemblyVersionCompatibility
- System.Reflection.AssemblyNameFlags
- System.Globalization.CultureTableRecord
- System.Globalization.CompareInfo
- System.Globalization.TextInfo
- System.Globalization.NumberFormatInfo
- System.Globalization.DateTimeFormatInfo
- System.Globalization.Calendar
- System.Globalization.BaseInfoTable
- System.Globalization.CultureTable
- System.Globalization.CultureTableData
- System.Globalization.NumberStyles
- System.Globalization.DateTimeStyles
- System.Globalization.DateTimeFormatFlags
- System.Globalization.TokenHashValue
- System.Globalization.CultureTableHeader
- System.Globalization.CultureNameOffsetItem
- System.Globalization.RegionNameOffsetItem
- System.Globalization.IDOffsetItem
- System.TokenType
- System.Char
- System.IO.TextReader
- System.IO.TextWriter
- System.IFormatProvider
- System.Console
- System.RuntimeTypeHandle
- System.NotSupportedException
- System.Globalization.EndianessHeader
- System.Reflection.Missing
- System.RuntimeType
- System.Threading.StackCrawlMark
- System.Globalization.CultureTableItem
- System.Int32
- System.Security.CodeAccessSecurityEngine
- System.AppDomain
- System.LocalDataStoreMgr
- System.Threading.ExecutionContext
- System.LocalDataStore
- System.Collections.ArrayList
- System.Threading.SynchronizationContext
- System.Runtime.Remoting.Messaging.LogicalCallContext
- System.Runtime.Remoting.Messaging.IllogicalCallContext
- System.Threading.Thread
- System.Collections.Generic.Dictionary`2
- System.Runtime.Remoting.Messaging.CallContextRemotingData
- System.RuApplication starting
- System.Collections.Generic.IEqualityComparer`1
- Runtime.Remoting.Messaging.CallContextSecurityData
- System.Array
- System.RuntimeFieldHandle
- System.Globalization.CultureTableRecord[]
- System.Text.StringBuilder
**This is for the compact framework CLR. Your mileage will vary if you run the same on the desktop CLR.
No comments:
Post a Comment