《环视.NET Framework.pptx》由会员分享,可在线阅读,更多相关《环视.NET Framework.pptx(35页珍藏版)》请在三一文库上搜索。
1、Visual Studio 2010 andVisual Studio 2010 and .NET Framework 4.NET Framework 4 NameName TitleTitle Microsoft CorporationMicrosoft Corporation A Look Back .NET 1.0.NET 1.1.NET 2.0 3.0 3.5 .NET 4 200220032008 CTP2005-08 CLR 1.0CLR 1.1CLR 2.0CLR 4 SP1 The .NET Framework Base Class Libraries The CLR JIT
2、.AsParallel() Parallel Computing Parallel LINQ (PLINQ) Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Why the DLR? Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Dynamic Language Runtime Why the DLR? Python Binder Ruby Binder COM Binder JSc
3、ript Binder Object Binder .NET Dynamic Programming Dynamic Language Runtime Expression TreesExpression TreesDynamic DispatchDynamic DispatchCall Site CachingCall Site Caching IronPythonIronRubyC#VB.NETOthers Dynamically Typed Objects Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); obj
4、ect calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember(“Add“, BindingFlags.InvokeMethod, null, new object 10, 20 ); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke(“Add“, 10, 20); int sum = Convert.ToInt32(res); dy
5、namic calc = GetCalculator(); int sum = calc.Add(10, 20); Statically typed to be dynamic Dynamic method invocation Dynamic conversion DLR Integration Type Equivalence Interop Assemblies translate between managed code and COM For each interface, struct, enum, delegate, and member, contains a managed
6、equivalent with marshalling data However! Primary Interop Assemblies cause many pain points Go Away, PIA! 1. Compilers embed the portions of the interop assemblies that the add-ins actually use 2. Runtime ensures the embedded definitions of these types are considered equivalent CLR 4 Type Equivalenc
7、e .NET Framework Compatibility .NET 4.0 is a highly compatible release .NET 4.0 does not autoroll forward You must add a configuration file with a specific switch to get 3.5 apps to run on 4.0 .NET Framework Compatibility Hang on if 4.0 is compatible, why not run 3.5 apps automatically on 4.0? The B
8、EST thing is always to prefer running on the version of the framework you built against CLR 2 - Existing Side-By-Side Host Process (i.e. Outlook) .NET 2.0 2.0 add-in 3.0 3.5 3.0 add-in 3.5 add-in 1.1 add-in .NET 1.1 CLR 4 - In-Process Side-By-Side .NET 2.0 .NET 4.0 2.0 add-in 3.0 3.5 Host Process (i.e. Outlook) 3.0 add-in 3.5 add-in 4.0 add-in Visual Studio 2010 Training Kit Download at http:/