Weitere ähnliche Inhalte Ähnlich wie Dotnetcore30forwindesktop (20) Kürzlich hochgeladen (10) Dotnetcore30forwindesktop5. ・内製 or 外注 企画〜運⽤保守
・業務アプリケーション、製品の良否判定
検査設備の予防/予兆保全など
対象 :従業員
開発⾔語:C#
チームとしての役割
完成⾞両の品質管理に関する
アプリケーション作成
7. • Termination of .NET Framework and future of .NET Core
• Why Windows Desktop on .NET Core
• Convert Windows Desktop App
DEMO
• Portability Analyzer
• Try Convert
• WinForms Designer
Agenda
9. 1.0 1.1 2.0 3.0 3.5 4.0 4.5 4.6 4.7 4.8
2000, XP
2000, XP,
Vista
2000,
XP, Vista, 7,
8, 8.1, 10
XP, Vista, 7, 8, 8.1, 10 XP, Vista, 7
Vista,
7, 8, 8.1
Vista, 7, 8,
8.1, 10
7, 8.1, 10,
10 Creators
Update
7, 8.1, 10
2000, 2003
2000, 2003,
2008
2000, 2003,
2008, 2012,
2016
2003, 2008, 2012, 2016 2003, 2008 2008, 2012
2008,
2012, 2016
2008, 2012,
2016
2008, 2012,
2016, 2019
2002 2003 2005 2008, 2010 2012 2013 2015 2017 2019
1.0 1.2 2.0 3.0 4.0 5.0 6.0 7.0 7.3
.NET Framework History
Jan.2002 Apr.2003 Nov.2005 Nov.2006 Nov.2007 Apr.2010 Aug.2012 Jul.2015 Apr.2017 Apr.2019
10. 1.0 1.1 2.0 2.1 2.2 3.0
7, 8, 8.1, 10 7, 8, 8.1, 10 7, 8, 8.1, 10 7, 8, 8.1, 10 7, 8, 8.1, 10 7, 8, 8.1, 10
2012, 2016 2012, 2016 2012, 2016 2012, 2016 2012, 2016 2012, 2016
2015 Update 3
2015 Update 3,
2017
2017 15.5 2017 15.8.6 2017 15.9 2017 16.0, 2019
6.0 6.0 7.1 7.2 7.3 8.0
.NET Core History
Jun.2016 Mar.2017 Aug.2017 May.2018 Dec.2018 Sep.2019
11. .NET Schedule
July 2019
.NET Core
3.0
RC
Sept 2019
.NET Core
3.0
Nov 2019
.NET Core
3.1
LTS
Nov 2020
.NET 5.0
Nov 2021
.NET 6.0
LTS
Nov 2022
.NET 7.0
Nov 2023
.NET 8.0
LTS
https://devblogs.microsoft.com/dotnet/introducing-net-5/
12. Application models not included in .NET 5
ASP.NET Web Forms
→ Blazor
WF (Windows Workflow Foundation)
→ Open source core workflow for Windows workflow
WCF (Windows Communication Foundation)
→ gRPC for WCF server and remoting
13. .NET Framework 4.8 が
最後のメジャーバージョン
.NET Framework 4.8 〜
• サポートライフサイクルポリシーは変更なし
• インストール先のWindows OS と同じライフサイクルポリシーが適⽤
(参考) ライフサイクルに関する FAQ ‒ .NET Framework :
https://support.microsoft.com/ja-jp/help/17455/lifecycle-faq-net-framework
既存 .NET Framework ベースの
アプリケーションはそのまま利⽤可能
15. • Deployment Flexibility
• side-by-side support
• Machine global or app local framework
• Self-contained EXEs
• Core runtime and API improvements
• Performance
Why Windows Desktop on .NET Core
.NET Core 3.0 ベースで Windows Forms, WPF アプリが開発可能に
※Windowsデスクトップ環境でのみ動作
17. • 新しく作成するアプリケーション
> .NET Core 推奨
.NET Framework or .NET Coreの考え方参考
• 既存のアプリケーション
• 頻繁に開発されている
> .NET Core への移植を検討
• その他
> .NET FrameworkのままでOK
> そもそも必要なのか?の検討も
18. 例 : とある部署の管理アプリケーション
1
5
15
43
50
0 10 20 30 40 50 60
ASP.NET Core MVC
Windows Service
ASP.NET MVC
WPF
WindowsForm
業務アプリケーション内訳
オンプレDBサーバー
.NET Framework 2.0 ~ 4.7.2
社内NuGet Serverでライブラリを管理
.NET Core 2.2
App Service + Azure SQL Server
1
0
13
30
15
0
5
2
13
35
0 10 20 30 40 50 60
ASP.NET Core MVC
Windows Service
ASP.NET MVC
WPF
WindowsForm
開発の状況
Active Completed
Desktop Appは継続的に開発しているものあり
Desktop→Webに変更も検討
ASP .NET MVCについては.NET Coreに移⾏中
20. Overview of the porAng process
サードパーティの依存関係
サードパーティの依存関係
packages.config/PackageReferenceで確認
.NET Coreでも動作するのか?
21. Overview of the porting process
サードパーティの依存関係
.NET Framework 4.7.2 以降へ
再ターゲット
.NET Core で特定の API がサポートされない場合に、
.NET Framework 固有のターゲットに対して API の代替を
確実に使⽤できる
22. Overview of the porting process
サードパーティの依存関係
移植計画の作成
.NET Framework 4.7.2 以降へ
再ターゲット
.NET Framework とターゲットの .NET Core プラットフォームの間の
コードの移植性を調査
ターゲットの .NET Core プラットフォームにない型と API
⾮推奨API検出
互換性の問題
25. Overview of the porAng process
サードパーティの依存関係
移植計画の作成
⾮推奨API検出
互換性の問題
.NET Framework 4.7.2 以降へ
再ターゲット
テストコードの移植
コードの移植時にテストを実⾏できるように、テストを移植
.NET Core Support:MSTest、NUnit、xUnit
27. アセンブリ情報の生成を修正
.NET Framework で作成された Windows Forms プロジェクト
AssemblyInfo.cs (⽣成されるアセンブリのバージョンなどのアセンブリの属性を格納)
SDK スタイルのプロジェクト
プロジェクトファイルに基づいて⾃動⽣成
2つのAssemblyInfoが競合してしまう為、以下のエラーが発⽣
30. Microsoft.Windows.Compatibility
https://www.nuget.org/packages/Microsoft.Windows.Compatibility
Windows 専⽤ API やプラットフォーム⾮依存 API などを提供
•コード ページ
•CodeDom
•構成
•ディレクトリ サービス
•描画
•ODBC
•アクセス許可
•ポート
•Windows アクセス制御リスト (ACL)
•Windows Communication Foundation (WCF)
•Windows 暗号化
•Windows EventLog
•WMI (Windows Management Instrumentation)
•Windows パフォーマンス カウンター
•Windows レジストリ
•Windows ランタイム キャッシュ
•Windows サービス
• NuGet package Microsoft.Windows.Compatibility
• Can be referenced from .NET Core & .NET Standard
• Has ~21k APIs (Windows-only as well as cross-platform)
37. WinForms Designer Preview 1
Pointer
Button
Checkbox
CheckedListBox
ComboBox
DateTimePicker
Label
LinkLabel
ListBox
ListView
MaskedTextBox
MonthCalendar
NumericUpDown
PictureBox
ProgressBar
RadioButton
RichTextBox
TextBox
TreeView
Visual Studio 2019 v16.3.0 Preview 4 ~
サポートされているコントロールはまだ少ない
Give us your feedback via Visual Studio !!
Support Controls
https://aka.ms/winforms-designer
42. • .NET Frameworkに⽐べ性能が良い
• ⾃⼰完結型の展開が可能
• クライアントマシンのフレームワークに依存しない
• ランタイムのパッチ適⽤等の展開不要
• 今後実装されるであろう便利な機能が利⽤可能
.NET Core 3.0 へ移植するメリット
43. • 新しく作成するアプリケーション
> .NET Core 推奨
.NET Framework or .NET Coreの考え方参考
• 既存のアプリケーション
• 頻繁に開発されている
> .NET Core への移植を検討
• その他
> .NET FrameworkのままでOK
> そもそも必要なのか?の検討も