Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Blazor WASMのアプリをMAUI Blazorに移行してみる
Search
tomokusaba
February 24, 2023
Programming
0
990
Blazor WASMのアプリをMAUI Blazorに移行してみる
.NETラボ 勉強会 2023年2月
Blazor WASMのアプリをMAUI Blazorに移行してみる
tomokusaba
February 24, 2023
Tweet
Share
More Decks by tomokusaba
See All by tomokusaba
Azure Well-Architected Framework入門
tomokusaba
1
160
Microsoft Playwright Testing廃止!
tomokusaba
0
61
Azure Well-Architected Framework入門
tomokusaba
1
400
WebアプリケーションのUI構築で気を付けてるポイント
tomokusaba
0
270
Azure Cloud Adoption Framework(計画編)
tomokusaba
1
100
速報Visual Studio 2026(Insiders)
tomokusaba
0
43
Cloud Adoption Framework(導入戦略)
tomokusaba
0
40
.NET開発者のためのAzureの概要
tomokusaba
0
320
薬屋のひとりごとにみるトラブルシューティング
tomokusaba
0
530
Other Decks in Programming
See All in Programming
Making Angular Apps Smarter with Generative AI: Local and Offline-capable
christianliebel
PRO
0
100
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
280
AI駆動開発カンファレンスAutumn2025 _AI駆動開発にはAI駆動品質保証
autifyhq
0
110
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
440
Introduce Hono CLI
yusukebe
6
3.3k
ビルドプロセスをデバッグしよう!
yt8492
0
200
KoogではじめるAIエージェント開発
hiroaki404
1
260
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
120
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
860
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
220
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
Researchlyの開発で参考にしたデザイン
adsholoko
0
100
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
192
56k
BBQ
matthewcrist
89
9.9k
A designer walks into a library…
pauljervisheath
209
24k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Agile that works and the tools we love
rasmusluckow
331
21k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
Transcript
Blazor WASMのアプリを MAUI Blazorに移行してみる 株式会社SAKURUG エンジニアリングユニット 草場 友光 .NETラボ 2023年2月
自己紹介 • 普段は主にWebFormsアプリの保守の お仕事をしてます。 • 古めのシステムが多いので時代に取り 残されぬよう新しい技術を一つでも入 れるよう日々努力しています。 • 2022/08-2023
Microsoft MVP (Developer Technologies) • tomo_kusaba
宣伝 【VISION】ひとの可能性を開花させる企業であり続ける VISIONに共感できる仲間募集中。
注意 • 個人の見解・解釈が多分に入っています。 • 見解の相違・事実誤認などありましたらご指摘ください。 • #dotnetlabでtweetすると右側に表示されます
今日の目的 • Blazor WebAssemblyで記述したアプリケーションは基本的に そのままのコードでMAUI Blazorに移行が可能です。 • しかし、ワークロードが異なるが故に全くそのままといういき ません。 •
先月見せたRESTAPI、MessagePack、MemoryPack比較用の アプリケーションを題材にして実際にMAUI Blazorに移行して みてその差異を探ってみたいといきます。
MAUI Blazorとは Blazor Hybrid Blazor技術も使ってMAUI のUIやコードを記述できる 技術 MAUIの様々なAPIも Razorコンポーネントの中に 記述できる
今回の移行順序 • 必要なパッケージを NuGet(MessagePack,MemoryPack,QuickGrid) • _imports.razorに「@using Microsoft.AspNetCore.Components.QuickGrid」を追加 • Null許容を有効化する •
モデルクラス(Yubin.cs)をコピー • MauiProgram.csにhttpClientサービスを追加 • Page配下の各razorページを移行 • Shared配下のNavMenuの表示を変更
移行元プロジェクト • https://github.com/tomokusaba/MessagePackView • https://kind-moss-0af0a4d00.2.azurestaticapps.net/ (GitHub) Static Web Apps
デモ
ワークロードによる差 • global usingで暗黙的に宣言されているパッケージ • MAUIはNull許容が有効化されていなかった。(.NET 7) • Microsoft.AspNetCore.Components.Hosting.WebAssembl yHostかMicrosoft.Maui.Hostか?
実機でデバッグしてみる(Android) • 準備 • デバイスで開発者モードを有効にする • 設定画面に移動 • 端末情報を選択 •
ビルド番号を7回タップ • USBデバッグを有効にする • 設定画面に移動 • 開発者向けオプションを選択 • USBデバッグオプションをオンにする • デバイスをPCに接続する • データ通信可能なUSBケーブルでPCと端末を接続する • デバイスのドライバーをインストールする(Android SDK Managerを使用 してGoogle USBドライバーをインストール)
ホットリロード • 実機でのデバッグ実行時でもホットリロード可能(重要)
デモ
移行後のMAUI Blazorアプリ • https://github.com/tomokusaba/MAUIBlazor
参考文献 • NET MAUI とは • ASP.NET Core Blazor Hybrid
おしまい おしまい