Windows 8 für .net Entwickler

Uploaded on

Actual Information about Windows 8 .

Actual Information about Windows 8 .

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Windows 8 key product : :)
    Are you sure you want to
    Your message goes here
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Windows 8 für .net EntwicklerPatric Student Technology Conference
  • 2. Architecture Metro style apps Desktop apps XAML HTML / CSS View C C# JavaScriptController Model C++ VB (Chakra) HTML C C# JavaScript C++ VB WinRT APIs System Services Communication Graphics & Media Devices & Printing & Data Internet .NET Application Model Win32 Explorer / SL Windows Core OS Services Core
  • 3. Sub- and Superset .NET Framework 4.5 Windows Phone 7 Silverlight 5 .NET Profile for Metro style apps
  • 4. Windows Managed Mapped Types Interop HelpersRuntime Types Types Int32, String, IBuffer / Byte[] Tuple, List<T>,99% of Windows* Boolean, IAsync* / Task* XDocument,namespaces IEnumerable<T>, InputStream, Output DataContract, etc. IList<T>, Uri, etc. Stream,
  • 5. Design Requirements• Remove APIs not applicable to Metro style apps – e.g. Console, ASP.NET• Remove dangerous, obsolete, and legacy APIs• Remove duplication (within .NET APIs and with WRT APIs) – e.g. ArrayList (with List<T>) and XML DOM (with WR XML API)• Remove APIs that are OS API wrappers – e.g. EventLog, Performance Counters• Remove badly designed APIs – e.g. APIs that are confusing, don’t follow basic design guidelines, cause bad dependencies
  • 6. Compatibility Requirements• Running existing .NET applications as-is on the .NET profile for Metro style apps is not an objective• Porting existing C# and VB code to the profile should be easy• Existing .NET developers should feel at home with this profile• Code compiled to the profile must be able to execute on .NET Framework 4.5• Code compiled to the portable subset needs to be compatible with this profile
  • 7. * Refers to implementation assemblies, not reference assemblies. More on this later.
  • 8. .NET for Metro style appsWCFXML MEFHTTP Serialization BCL
  • 9. Main NamespacesSystemSystem.Collections*System.ComponentModelSystem.ComponentModel.Composition*System.Diagnostics*System.DynamicSystem.GlobalizationSystem.IOSystem.Linq*System.Net*System.ReflectionSystem.Runtime.InteropServices*System.Runtime.Serialization*System.ServiceModel*System.Text*System.ThreadingSystem.Threading.TasksSystem.Xml.*System.Xml.Linq
  • 10. Action System Namespace* Simplicity GC SByteAction<...> Guid SingleActivator IAsyncResult StringArray IComparable<T> StringComparerArraySegment<T> ICustomFormatter StringComparisonAsyncCallback IDisposable StringSplitOptionsAttribute IEquatable<T> ThreadStaticAttributeAttributeTargets IFormatProvider TimeSpanAttributeUsageAttribute IFormattable TimeZoneInfoBitConverter Int16 TupleBoolean Int32 Tuple<...>Byte Int64 TypeChar IntPtr TypedReferenceCLSCompliantAttribute IObservable<T> UInt16Convert IObserver<T> UInt32DateTime Lazy<T> UInt64DateTimeKind Math UIntPtrDateTimeOffset MidpointRounding UriDayOfWeek MulticastDelegate UriBuilderDecimal Nullable UriComponentsDelegate Nullable<T> UriFormatDouble Object UriKindEnum ObsoleteAttribute ValueTypeEnvironment ParamArrayAttribute VersionEventArgs Predicate<T> VoidEventHandler Random WeakReferenceEventHandler<T> RuntimeArgumentHandle WeakReference<T>Exception RuntimeFieldHandleFlagsAttribute RuntimeMethodHandleFunc<...> RuntimeTypeHandle * excluding exceptions
  • 11. Removed, Replaced, and Changed – System.Web – System.Data – System.Runtime.Remoting – System.Reflection.Emit – Private reflection – Application Domains
  • 12. Removed, Replaced, and ChangedExisting Technology New SubstituteSystem.Windows Windows.UI.XamlSystem.Security.IsolatedStorage Windows.Storage.ApplicationDataSystem.Resources Windows.ApplicationModel.ResourcesSystem.Net.Sockets Windows.Networking.SocketsSystem.Net.WebClient Windows.Networking.BackgroundTransfer and System.Net.HttpClient
  • 13. Removed, Replaced, and ChangedExisting Technology ChangesSerialization • Use Data Contract for general serialization needs • Use XML serialization for fine control of the XML streamReflection • System.Type now represents a type reference • System.Reflection.TypeInfo is the new System.TypeXML • XML Linq is the main XML parser • Use XmlReader/Writer as a low level abstractionCollections • Non generic collections gone • New collection abstractions added: IReadOnlyList<T>Threading • Synchronization primitives mainly unchanged • Thread control in Windows.Foundation.Threading • Task.Run is the new high level way of doing background processingAsync Model • !!!!
  • 14. Porting Guide: Example TopicReflectionSystem.Type has become a type reference and only contains basic information. The majority of the reflection APIsare now on System.Reflection.TypeInfo. You can get a TypeInfo from a Type by using the GetTypeInfo() extensionmethod when you include a using statement for the System.Reflection namespace.Existing .NET Code Replacement Code Notestype.Assembly type.GetTypeInfo().Assemblytype.GetMethods(BindingFlags.DeclaredOnly type.GetTypeInfo().DeclaredMethods)type.GetMethod("MethodName", type.GetTypeInfo().GetDeclaredMethod("Met These samples are the same for Properties,BindingFlags.DeclaredOnly) hodName") Events, and Fields.type.GetMethod("MethodName") type.GetRuntimeMethod("MethodName") GetRuntimeMethod API in Beta.type.GetMethods() type.GetRuntimeMethods() GetRuntimeMethods() API in Beta.type.GetMethods(BindingFlags.Instance|Bindi type.GetRuntimeMethods().Where(m => GetRuntimeMethods() API in Beta.ngFlags.Public) !m.IsStatic && m.IsPublic)BindingFlags.NonPublic !member.IsPublic You can also use member.IsAssembly => internal or member.IsFamily => protected for more flexibility
  • 15. • .net 4.5 & Visual Studio 11 Tools Programming Models Parallel C#/VB/F# Debugger PLINQ Async Dataflow Async Parallel C++ Stacks Agents Pattern AMP Task Parallel Library Library Library Data Structures Data Structures Tasks Watch CPU GPU Runtime Concurrency CLR ThreadPool ConcRT Visualizer CPU GPU Task Scheduler Task Scheduler DirectX Threads Resource Manager Resource Manager Cores Operating System Windows Key: Tooling Managed Native New Updated
  • 16. Async Implementation• Task Representation as Feature in .net and Languages – Produce and Consume Async Operations• When you write a Async Method – You Producing a Task<T> or Results Task<T>• When you use Await – You await Task<T> or Results Task<T>
  • 17. Mental Model• We all “know” sync methods are “cheap” – Years of optimizations around sync methods – Enables refactoring at will public static void SimpleBody() { Console.WriteLine("Hello, Async World!"); } .method public hidebysig static void SimpleBody() cil managed { .maxstack 8 L_0000: ldstr "Hello, Async World!" L_0005: call void [mscorlib]System.Console::WriteLine(string) L_000a: ret }
  • 18. Mental Model, cont. .method public hidebysig instance void MoveNext() cil managed { // Code size 66 (0x42) .maxstack 2 .locals init ([0] bool <>t__doFinallyBodies, [1] class [mscorlib]System.Exception <>t__ex)• Not so for asynchronous methods .try { IL_0000: ldc.i4.1 IL_0001: stloc.0 IL_0002: ldarg.0 IL_0003: ldfld int32 Program/<SimpleBody>d__0::<>1__state IL_0008: ldc.i4.m1 public static async Task SimpleBody() { IL_000d IL_0009: bne.un.s Console.WriteLine("Hello, Async World!"); IL_000b: leave.s IL_0041 IL_000d: ldstr "Hello, Async World!" } IL_0012: call void [mscorlib]System.Console::WriteLine(string) IL_0017: leave.s IL_002f .method public hidebysig static class} [mscorlib]System.Threading.Tasks.Task SimpleBody() cil managed { catch [mscorlib]System.Exception { .custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 ) IL_0019: stloc.1 // Code size 32 (0x20) IL_001a: ldarg.0 .maxstack 2 IL_001b: ldc.i4.m1 .locals init ([0] valuetype Program/<SimpleBody>d__0 V_0) Program/<SimpleBody>d__0::<>1__state IL_001c: stfld int32 IL_0000: ldloca.s V_0 IL_0021: ldarg.0 IL_0002: call IL_0022: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/<SimpleBody>d__0::<>t__builder [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create() IL_0027: ldloc.1 IL_0007: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/<SimpleBody>d__0::<>t__builder IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException( IL_000c: ldloca.s V_0 class [mscorlib]System.Exception) IL_000e: call instance void Program/<SimpleBody>d__0::MoveNext() IL_002d: leave.s IL_0041 IL_0013: ldloca.s V_0 } IL_0015: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/<SimpleBody>d__0::<>t__builder IL_002f: ldarg.0 IL_001a: call instance classIL_0030: ldc.i4.m1 [mscorlib]System.Threading.Tasks.Task IL_0031: stfld int32 Program/<SimpleBody>d__0::<>1__state [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task() IL_0036: ldarg.0 IL_001f: ret IL_0037: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder } Program/<SimpleBody>d__0::<>t__builder IL_003c: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult() IL_0041: ret }
  • 19. • Managed Profile Guided Optimization (for .net Applications)
  • 20. • More Information•• Twitter: @patricsmsdn• Blog:• Search for:• ASYNC -> Stephen Toub• .GC -> Pracheeti Nagarkar• MPGO -> Mark Miller• .net -> BCL Team Blog & Krzysztof Cwalina, Immo Landwerth and Joshua Goodman