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
980
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
速報Visual Studio 2026(Insiders)
tomokusaba
0
38
Cloud Adoption Framework(導入戦略)
tomokusaba
0
27
.NET開発者のためのAzureの概要
tomokusaba
0
250
薬屋のひとりごとにみるトラブルシューティング
tomokusaba
0
470
Cloud Adoption Framework入門
tomokusaba
1
39
GitHub Copilot の概要
tomokusaba
1
180
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
550
Azure AI Foundry Agent Serviceを使用してコードファースト アプリを構築する
tomokusaba
1
340
Part1 GitHubってなんだろう?その1
tomokusaba
3
1k
Other Decks in Programming
See All in Programming
Cache Me If You Can
ryunen344
2
4k
アセットのコンパイルについて
ojun9
0
130
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
130
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
為你自己學 Python - 冷知識篇
eddie
1
350
チームのテスト力を鍛える
goyoki
3
940
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
710
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
110
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.6k
Deep Dive into Kotlin Flow
jmatsu
1
370
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
184
22k
Scaling GitHub
holman
463
140k
GitHub's CSS Performance
jonrohan
1032
460k
KATA
mclloyd
32
14k
Music & Morning Musume
bryan
46
6.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Six Lessons from altMBA
skipperchong
28
4k
How to train your dragon (web standard)
notwaldorf
96
6.2k
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
おしまい おしまい