DEV304 .NET 4.5 核心功能及綜覽 蔡孟儒 技術推廣協理 台灣微軟技術暨平台推廣處.

Slides:



Advertisements
Similar presentations
Why data services? Common challenges when creating rich web applications Creating rich web applications with data services Future scenarios & roadmap.
Advertisements

Building Windows Runtime Components in C++ Harry Pierson Program Manager, Windows Runtime Experience Team Microsoft Corporation.
GrapeCity Build Experiences with Enterprise-level Tools and Solutions
Unleash .NET 2015 in your apps
50 Performance Tricks to Make your HTML5 apps and sites Faster
The Future of C# and Visual Basic
ASP.NET Core: Web apps, cloud apps, and containers
TechEd /1/2018 7:56 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
6/2/2018 4:08 AM BRK3327 Ten things you didn't know about building .NET UWP apps in Visual Studio 2017 Daniel Jacobson Program Manager – Visual Studio.
Windows Phone 8.1 New Features
The Future of C# The Future of C# and VB 2-577
Platform for Metro Style Apps
Modern application lifecycle with DevOps
The Modern ASP.NET Tech Stack!
Developing Drivers in Visual Studio
Build data-driven collection and list apps using XAML
Manual testing of Windows Metro style apps built using HTML
End to end app development ASP.NET, WCF, WF, EF, & RIA Services
DNN Connect 2017 Microsoft Keynote
What web developers need to know when building Metro style apps
Building real-time web apps with WebSockets using IIS, ASP.NET and WCF
Myth Busting: Hosted Web Apps
Using the Windows Runtime from C# and Visual Basic
Using JavaScript to Build HTML5 Applications
Microsoft Build /8/2018 8:41 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Building Modern Web Apps with ASP.NET MVC 6
Windows Phone multitasking
DotnetConf 11/14/2018 3:27 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
HTML5 Platform from Web to Apps
Using the Windows Runtime from JavaScript
Debugging your Metro style apps using HTML
11/19/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Office 365 Development July 2014.
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
MIX 09 11/23/2018 6:07 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Bring existing desktop apps to UWP with the Desktop Bridge
Tooling and Diagnostics
12/2/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Office 365 Development July 2014.
Building responsive apps and sites with HTML5 web workers
Windows Runtime internals: understanding "Hello World"
F# for Parallel and Asynchronous Programming
Microsoft Virtual Academy
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
TechEd /9/2018 4:17 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Tech Ed North America /1/ :36 AM Required Slide
Introducing Metro style device apps
LitwareHR v2: an S+S reference application
Building Metro style apps with XAML with .NET
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build /23/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Platform for Metro style Apps
Using Windows Runtime and SDK to build Metro style apps
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Microsoft Office 4/3/2019 Deep Dive into native Universal App development with the Office 365 APIs Speaker name Title Microsoft Corporation © 2012 Microsoft.
TechEd /3/ :48 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Silverlight Debugging
Silverlight 2 Mike Taulty Developer & Platform Group Microsoft Ltd
Brandon Bray Principal Group Program Manager Microsoft Corporation
4/19/2019 1:57 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Enterprise Developer Camp Jumpstart
What’s new in Visual Studio 2012
Build /4/ Diagnosing issues with Windows Phone 8.1 JavaScript apps using Visual Studio Andy Sterland Senior Program
Leveraging existing code in Metro style apps
ASP.NET Roadmap: One ASP.NET – Web Forms, MVC, Web API, and more
Build /15/2019 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
7/19/2019 2:53 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Erik Porter Program Manager ASP.NET Microsoft Corporation
03 | Async Programming & Networking Intro
What’s New for Developers in Office and SharePoint
Presentation transcript:

DEV304 .NET 4.5 核心功能及綜覽 蔡孟儒 技術推廣協理 台灣微軟技術暨平台推廣處

你會聽到什麼? .NET 4.5重要的新特色概述 Demo TechReady 14 9/21/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

WHY Change? 在趨勢的演進中拉距 傳統商業應用程式 新型態 Apps 高品質 高可靠性 高可預測性 缺少彈性 緩慢反應市場需求 Visual Studio 11 9/21/2018 WHY Change? 在趨勢的演進中拉距 傳統商業應用程式 高品質 高可靠性 高可預測性 缺少彈性 緩慢反應市場需求 新型態 Apps 更好的使用者經驗 高度彈性 快速面對市場需求 IT管理漏洞 Apps 孤島 These trends are causing the Enterprise IT to fragment in two big areas: LOB Apps: These are the traditional, core apps to the business. These apps have high requirements of quality, predictability, and maintenance but they are suffering slower times to market and lack of flexibility. Strict processes avoid these apps to stay competitive in a world where agility, adapt to change, and time to market are critical to succeed. Modern Apps: LOB Apps constraints can not support the agility and flexibility needs of modern apps. Because of that reason Enterprises are creating a second muscle with a different speed in the organization. While this muscle can deliver on those needs, it creates a silo in the org with intrinsic problems of quality assurance, predictability, and maintenance. Apps are created on demand, with low to none planning and architecture and without orchestration between them. As time evolves, this turns into a “big ball of mud” with applications that can’t talk with each other and are difficult to maintain and evolve. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

<Event/Group Name> 9/21/2018 趨勢 改變 更貼近終端用戶 面業IT消費化的挑戰 手持智慧性裝置增殖 經濟規模成長 無所不在且龐大的資料 The two big IT trends that are shaping the future of Enterprise LOB Apps are: Mobility and devices proliferation: The proliferation of consumer devices in different form factors and always connected are impacting the way Enterprises are not only defining their direct-to-consumer channels. The availability of these devices also enables new scenarios inside a company (for example mobile workforces) and, because of the consumerization of IT, also the way traditional LOB apps are consumed internally in a company. Cloud computing: Initially evaluated by Enterprises as a mechanism to embrace economies of scale and lower costs, cloud computing and specially Hybrid IT is also matching the needs of the new applications of always connected devices for LOB apps. 雲端運算 © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

.NET 版本簡史 .NET 4.5 於安裝時取代.NET 4 (或升級Windows 8時) 2002 2003 2005 2008 2010 2012 橫線上的較新版本皆為in-place updates (就地更新) .NET 3.5 .NET 4.5 .NET 4 .NET 4.5 於安裝時取代.NET 4 (或升級Windows 8時) .NET 4 仍可在Visual Studio 2012 中設為目標Framework .NET十年了 .NET 1.0: 2012/02/13 每一條橫線是side-by-side,也就是說,你的客戶安裝了1.0,那若客戶再安排1.1,會是不同的runtime, App可以target version, everything running side-by-side (http://blogs.msdn.com/b/dotnet/archive/2011/09/26/compatibility-of-net-framework-4-5.aspx) .NET 2.0 another side-by-side .NET 3.0是in place updates,意思是以.NET 2.0開發的application可以run在.NET 3.0上 若你的App run在.NET 4, after in place update,App可跑在.NET 4.5 ( .NET 4.5 is the version number (4.0.30319) is the same as .NET 4; this is the practice used by other in-place updates.)

.NET 4.5 的高度相容 3種主要的相容測試 Binary Source Serialization 不同容的Visual 2010專案: setup, ASP.NET MVC 2 (不支援!)、Database project Migration Guide to the .NET Framework 4.5: http://msdn.microsoft.com/en-us/library/ff657133(v=VS.110).aspx Application Compatibility in the .NET Framework 4.5 http://msdn.microsoft.com/en-us/library/hh367887(v=VS.110).aspx

.NET 4.5 的高度相容 (續) Windows XP 不支援 .NET 4.5 Visual Studio 2010 大部份的專案可在無需更動之下,在Visual Studio 2012中開啟 http://msdn.microsoft.com/en-us/library/hh266747(VS.110).aspx

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

Windows Core OS Services Windows Store Apps HTML JavaScript C C++ C# VB Desktop Apps Win32 .NET / SL Internet Explorer JavaScript (Chakra) C C++ C# VB XAML HTML / CSS View Model Controller Communication & Data Application Model Devices & Printing WinRT APIs Graphics & Media System Services DirectX沒有畫在這張圖內 Windows Core OS Services Core

跨入 Windows 8 之技術地圖 Windows 7 Windows 8 Desktop HTML/Browser .NET WinForms .NET/XAML WPF Desktop .NET/XAML Silverlight HTML/JS ASP.NET HTML/Browser HTML/JS WinRT .NET/XAML WinRT C++/ XAML/DX Windows Store app Depending upon your existing experience and skills, Windows 8 provides you will a continued path for delivering great applications for your users and business. As you can see, Windows Forms, WPF Desktop applications, Silverlight, and traditional browser-based applications are still fully supported. However, if you’re ready to deliver more innovative and immersive experiences, you can start building Windows Store Applications for Windows 8. Regardless of your background, there’s a set of templates and libraries to get you there quicker. Visual Studio 2012 provides you with tools to build all of these applications. Windows 8

WinRT in C++ - Hello World auto dlg = ref new Windows::UI::Popups::MessageDialog ( "Hello world" ); dlg->ShowAsync();

C++版的WinRT App… C++ 程式碼的可移植性(過去投資的C/C++資產) XAML可以和 C++ 搭配一起運作 9/21/2018 C++版的WinRT App… C++ 程式碼的可移植性(過去投資的C/C++資產) XAML可以和 C++ 搭配一起運作 WinRT APIs 是原生(Native)的 Native == performance .. There are no abstractictions here.. It is literally v-table pointer jumps.. C++ now has a new presentation language. On-going investment with XAML… tooling investment.. You can also do DirectX …. If your schedule allows definitely show a DX game.. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WinRT APIs User Interface Devices Communications & Data Media 9/21/2018 WinRT APIs User Interface SVG Tiles Input Accessibility Printing HTML5/CSS XAML DirectX Controls Data Binding Devices Geolocation Portable Sensors NFC Communications & Data Memory Management XML Networking SMS Notifications Streams Contracts Local & Cloud Storage Web Media Playback Capture PlayTo Visual Effects Create a Camera Capture UI demo. Seamless integration with devices and OS resources. Fundamentals Application Services Threading/Timers Memory Management Authentication Cryptography Globalization © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WinRT in C#

C#版的WinRT App… WinRT APIs 對於硬體裝置、作業系統與服務提供了豐富的功能 9/21/2018 C#版的WinRT App… WinRT APIs 對於硬體裝置、作業系統與服務提供了豐富的功能 WinRT APIs 可以和 C#、JavaScript與C++搭配的非常順暢 WinRT APIs 是非同步的(Asynchronous) You just saw that WinRT leverages the Async pattern to keep the UI responsive.. This happens across all languages.. The WINRT API has meta data that the platform uses to create projections that make using the API very natural.. There is a lot of power behind WInRT… a few lines of code and we had a dialog selecting a file using a common UX paradigm that all users will be familiar with promptly.. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WinRT 之語言映射: Language Projections Windows Runtime Object (或 Component) 使用C++, C#, VB 所撰寫 C++ App Projection CLR Projection C#/VB App ECMA 335 Different languages work together. Write Library code in C++ or C# consumable by all (but must be included in package). Subset of Win32 APIs Again projection JS casing example Control type differences across. Mix and match different languages. Windows runtime objects or components basically Dlls WinMD files, can use subset of Win32 APIs, can expose functionality to all languages through “projection” We take care of making sure that these projections work in the way the origional language intended, controling types, casing, etc. Allows writing native C++ code with xaml UI. Adapted from slides 18 and 19 of PLAT-874T Projection Chakra HTML App Windows Metadata

.NET 4.5 內建之 Windows Metadata檔案

以前要做到相同的事 in C#... [DllImport("avicap32.dll", EntryPoint="capCreateCaptureWindow")] static extern int capCreateCaptureWindow( string lpszWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, int hwndParent, int nID); [DllImport("avicap32.dll")] static extern bool capGetDriverDescription( int wDriverIndex, [MarshalAs(UnmanagedType.LPTStr)] ref string lpszName, int cbName, [MarshalAs(UnmanagedType.LPTStr)] ref string lpszVer, int cbVer); // more and more of the same © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

在 WinRT 中… using Windows.Media.Capture; var ui = new CameraCaptureUI(); ui.PhotoSettings.CroppedAspectRatio = new Size(4, 3); var file = await ui.CaptureFileAsync(CameraCaptureUIMode.Photo); if (file != null) { var bitmap = new BitmapImage() ; bitmap.SetSource(await file.OpenAsync(FileAccessMode.Read)); Photo.Source = bitmap; } © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

在Desktop Applications使用WinRT APIs? Windows.Sensors (Accelerometer, Gyrometer, Ambient Light Sensor, OrientationSensor...) Windows.Networking.Proximity.ProximityDevice (NFC) Windows.Device.Geolocation (GPS) Windows.UI.Notifications.ToastNotification Windows.Globalization Windows.Security.Authentication.OnlineId (including LiveID integration) Windows.Security.CryptographicBuffer (usefull binary encoding/decoding functions) Windows.ApplicationModel.DataTransfer.Clipboard (access and monitor Windows 8* Clipboard) http://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

同步Synchronous vs. 非同步Asynchronous var data = DownloadData(...); ProcessData(data); STOP ProcessData DownloadData var future = DownloadDataAsync(...); future.ContinueWith(data => ProcessData(data)); DownloadDataAsync ProcessData © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

.NET 以往處理非同步運算的方法 直接使用 thread 使用 thread pool TechReady 14 9/21/2018 11:25 AM .NET 以往處理非同步運算的方法 直接使用 thread Thread t = (new Thread(..)).Start() 使用 thread pool ThreadPool.QueueUserWorkItem( (s)=>Foo(s) ) Event-Based callback functions WinForms 時代 APM (Asynchronous Programming Model,導入Begin/End 模式;Task in .NET 4) 有彈性,但仍然難以學習及輕鬆使用 在 Thread-Per-Message 模式 中,每次請求來到,就建立一個新的執行緒,用完就不再使用,然後執行緒的建立需要系統資源,對於一個接受許多請求的情況,不斷的建立新執行緒,會導致系統效能的降低。 Thread pool 模式的概念就是,需要使用執行緒時,在一個執行緒池中尋找可用的執行緒,如果找不到再建立新的,執行緒使用完畢後,留在池中重複使用。 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WinRT Camera Capture

Async in WPF

除了好寫、易讀,debug更容易 TechReady 14 9/21/2018 11:25 AM private void UseData(String filePath) {   Byte[] buff = new Byte[BuffSize]; using (Stream str = File.OpenRead(filePath)) { IAsyncResult asRes = str.BeginRead(buff, 0, buff.Length, (ar) => { if (!ar.CompletedSynchronously) { Int32 len = str.EndRead(ar); ProcessData(buff, len); } }, state: null); if (asRes.CompletedSynchronously) { Int32 lenRes = str.EndRead(asRes); ProcessData(buff, lenRes); private async Task UseDataAsync(String filePath) {   Byte[] buff = new Byte[BuffSize]; using (Stream str = File.OpenRead(filePath)) { Int32 lenRes = await str.ReadAsync(buff, 0, buff.Length); ProcessData(buff, lenRes); } * Can you spot the bug? © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

.NET 4.5 引入Async技術, 也就是關鍵字 async / await 大幅簡化非同步程式設計的難度

Async方法會被 .NET4.5 編譯器展開成過去熟悉的程式撰寫方式, 屬於Compiler Sugar http://blogs.microsoft.co.il/blogs/bnaya/archive/2011/12/29/the-concept-of-async-await.aspx

9/21/2018 Async in WinRT http://blogs.msdn.com/b/windowsappdev/archive/2012/04/24/diving-deep-with-winrt-and-await.aspx http://blogs.msdn.com/b/windowsappdev/archive/2012/04/24/diving-deep-with-winrt-and-await.aspx © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Asynchronous APIs in .NET 4.5 .NET 4.5 中已有數百個函式被改寫為新的Async APIs;主要針對C#及VB。 最顯著的例子在 I/O 相關函式庫,如: 任何出現”Async”關鍵字的函式: ReadAsync, WriteAsync, CopyToAsync, FlushAsync, ReadLineAsync, & ReadToEndAsync. 以及在Stream class上的實作: Stream, FileStream, MemoryStream, TextReader & TextWriter. http://msdn.microsoft.com/en-us/library/kztecsys

C#/VB Async: Error Handling To handle the exception in C# or Visual Basic, you use a try/catch block just as you do with synchronous code today:   var title; var feedUri = new Uri("http://www.devhawk.com/rss.xml"); var client = new Windows.Web.Syndication.SyndicationClient(); try { var feed = await client.RetrieveFeedAsync(feedUri); title = feed.Title.Text; } catch (Exception ex) { // An exception occurred from the async operation }

WinRT Async primitives

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

你是哪種.NET開發者? API Profile 9/21/2018 你是哪種.NET開發者? API Profile Portable Class Library Portable Class Library http://msdn.microsoft.com/library/gg597391(v=vs.110).aspx http://msdn.microsoft.com/library/gg597391(v=vs.110).aspx © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

.NET 各功能在不同平台/版本之支援

MSDN 文件中的標示 MSDN中出現 符號即表示支援Portable Class Library 例: System.Char Public XNA Static Portable class library

Portable Class Library 可攜式類別庫

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

ONE ASP.NET “Don‘t think of ASP.NET as an island. It’s a citizen of the larger community. More and more of ASP.NET is open source, and we push hard every day to stay open and be open. We want to make ASP.NET more pluggable, more open, more fun. We‘ve got big things planned - some that will surprise you. I hope you’ll join the conversation and the community. “ - Scott Hanselman

ONE ASP.NET

新 ASP.NET MVC 4 專案

ASP.NET MVC 4 - Internet Application

我們剛看到… ASP.NET 4.5 各 web 控制項已使用HTML5 引入 Responsive Web Design 觀念 EF Code First in MVC 4

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

ASP.NET Web API 提供一個在建基於ASP.NET framework 之上的開發平台,讓你能在 MVC 的架構下作出HTTP Services Why ASP.NET Web API? 延展至更多的應用: Mobile, Browsers and other devices 在MVC架構下: 能藉由雲端平台scale-out 擁抱 HTTP: 一致並簡化與 client 端之間的溝通 讓 Browsers, Mobile App, Client applications, and other devices 等可以直接存取服務,使用如xml, json, etc

ASP.NET MVC 4 - Web API 選擇Web API模版,讓各種類的資料以Restful service的方式呈現 看WebAPIConfig看routing table

大綱 .NET 簡史以及相容性 .NET 4.5 重要特色 .NET for Windows 市集應用程式 Async & Await Portable Class Library ONE ASP.NET – MVC 4, Web API, Bundling & Minification

Bundling and Minification 打包與縮減 大量的JavaScript及CSS檔案,會增加瀏覽器HTTP請求的數量,造成頻寬增加、回應速度變慢

Bundling (打包) 將JavsScript及CSS檔合成為一,降低瀏覽器 Request的次數

Minification (縮減) 在原始JavaScript及CSS檔案中,移除空白、註解及不需要的字元,以降低檔案大小。 可與Bundling一併使用,或獨立使用。 Visual Studio 2012 預設於所有Web 專案中皆實作 Bundling & Minification

Bundling and Minification 打包與縮減

當然,還有許多許多… 更快、更好! WCF: Entity Framework: Wnidows Workflow: 包含 multicore JIT, MPGO, and big wins in CLR garbage collection, fully ZIP compliant library WCF: 更好的效能、穩定度及 WebSockets 擴充。並增添custom X509 在 client-side validation 之支援 Entity Framework: 支援 enum properties 及 spatial data types Wnidows Workflow: WorkflowServiceHost 支援 side-by-side instances

總結

Windows Store App 大募集 活動期間: 2012/09/20 ~ 2012/11/09 http://aka.ms/Win8AppFest

如果您對開發App有興趣… 請於 9/20 13:30 -14:40 到103 教室與我們對談 沒錯! 就是你! 現場還備有限量精美贈品!

Windows Store 帳號 年費: 公司帳戶:NT$2,840 個人帳戶:NT$1,420 12個月免費: MSDN 訂戶 BizSpark 計劃: 新創資訊公司 DreamSpark 計劃: 老師、學生

Reference What’s New in .NET 4.5 MSDN: http://msdn.microsoft.com/en-us/library/ms171868(v=vs.110) App: http://code.msdn.microsoft.com/Whats-New-in-the-NET-e8d7545c