Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Blazor WASMのアプリをMAUI Blazorに移行してみる
Search
tomokusaba
February 24, 2023
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Blazor WASMのアプリをMAUI Blazorに移行してみる
.NETラボ 勉強会 2023年2月
Blazor WASMのアプリをMAUI Blazorに移行してみる
tomokusaba
February 24, 2023
More Decks by tomokusaba
See All by tomokusaba
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
140
30代後半からでも遅くないキャリア形成
tomokusaba
0
300
GitHub Copilotで書いたコード、レビューはどうしてる?
tomokusaba
0
64
Azure CAFで考えるAIエージェント導入の進め方
tomokusaba
1
130
GitHub Copilot app時代の開発フロー
tomokusaba
0
87
オートマトンと字句解析でRoslynを読む
tomokusaba
0
180
GitHub Copilot appとGitHub Copilot CLIとVS CodeのCopilot Chat Agent Modeの使い分け
tomokusaba
0
230
GitHub Copilot app最速の発信の裏側
tomokusaba
1
610
自宅サーバの変遷
tomokusaba
0
950
Other Decks in Programming
See All in Programming
setup-vp GitLab対応の裏側
naokihaba
0
140
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
430
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
120
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
290
SREの越境 / SRE Collaboration
y0hgi
2
290
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.3k
The Rails Doctrine Decade
koic
2
440
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
110
Intent as Code
shoppingjaws
6
1.1k
mrbgem 三角測量 開発
ogom
0
170
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
Mind Mapping
helmedeiros
1
390
Chasing Engaging Ingredients in Design
codingconduct
0
340
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
620
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Six Lessons from altMBA
skipperchong
29
4.5k
From π to Pie charts
rasagy
1
380
Designing for Performance
lara
611
70k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
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
おしまい おしまい