実現したいこと
Visual Studio Community で、.NET MAUI を使ってHello World を作ろうとしたが、
ビルドできなくなってしまった。
ビルド、実行できるようにしたい。
発生している問題・分からないこと
エラーメッセージ
error
1ユーザーが処理していない例外 2Microsoft.Maui.Controls.Xaml.XamlParseException: 'Position 11:9. DataTemplateExtension: Could not locate type for local:MainPage.'
該当のソースコード
cs
1// AppShell.xaml.sg.cs 2//------------------------------------------------------------------------------ 3// <auto-generated> 4// This code was generated by a .NET MAUI source generator. 5// 6// Changes to this file may cause incorrect behavior and will be lost if 7// the code is regenerated. 8// </auto-generated> 9//------------------------------------------------------------------------------ 10 11[assembly: global::Microsoft.Maui.Controls.Xaml.XamlResourceId("_2025_08_31__test1.AppShell.xaml", "AppShell.xaml", typeof(global::_2025_08_31__test1.AppShell))] 12namespace _2025_08_31__test1 13{ 14 [global::Microsoft.Maui.Controls.Xaml.XamlFilePath("AppShell.xaml")] 15 public partial class AppShell : global::Microsoft.Maui.Controls.Shell 16 { 17 [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Maui.Controls.SourceGen", "1.0.0.0")] 18#if NET5_0_OR_GREATER 19#endif 20 private void InitializeComponent() 21 { 22#pragma warning disable IL2026, IL3050 // The body of InitializeComponent will be replaced by XamlC so LoadFromXaml will never be called in production builds 23 global::Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml(this, typeof(AppShell)); 24#pragma warning restore IL2026, IL3050 25 } 26 } 27} 28
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
例外メッセージで検索しましたが、英語しかヒットしませんでした。
また、英語でも情報もなかったような気がします。(英語は基本読めない)
同時並行で、Visual Studio Code へ、.NET SDK 9,0 をインストールしました。
これが影響しているのかも。
Avalonia UI も Visual Studio Code へ、インストールしました。
補足
Windows 11
Visual Studio Communiey 2022
.NET MAUI
Avalonia" Version 11.3.4 << これのせい?
.NET SDK 9.0 << もしくはこれのせい?

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。