[BUG] CommandBehavior not found when using global xmlns

オープン
#3,296 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp

調査の方向性

リンクされた TaskManagerApp の再現とそのグローバル xmlns ファイルから始め、次に EventToCommandBehavior エラーと、ViewModel の Init メソッドに対する IntelliSense の欠落を再現します。グローバル xmlns 定義がある場合とない場合の動作を比較します。完了条件は、アプリが引き続きビルドでき、Visual Studio が誤ったエラーや IntelliSense の欠落を報告しないことです。

索引モデルが issue の本文から書いたものです。

説明

bug unverified
Is there an existing issue for this?
  • I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior

NOTE: THIS IS NOT A BUG, BUUT I DID NOT KNOW WHERE TO PUT IT

I made my global file like this

`//
// Tus namespaces
//
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "TaskManagerApp.Controls")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "TaskManagerApp.Models")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "TaskManagerApp.ViewModels")]

//
// CommunityToolkit.Maui (TODOS los namespaces necesarios)
//
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "CommunityToolkit.Maui")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "CommunityToolkit.Maui.Behaviors")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "CommunityToolkit.Maui.Extensions")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "CommunityToolkit.Maui.Core")]`

The app work perfectly

but the error is that appear is annoying

The type 'EventToCommandBehavior' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

also if you create a Init method in your vm, intelisense dont work

Expected Behavior

VS dosent output any errors

Steps To Reproduce

Create a project
create a globbal xmlns file like mane

put a eventToCommand

Link to public reproduction project repository

https://github.com/eduardoagr/TaskManagerApp

Environment
- .NET MAUI CommunityToolkit:
- OS:
- .NET MAUI:
Anything else?

No response

主要言語
C#
スター
2.7k
フォーク
503
平均マージ
11時間 10分
マージ済み PR(30日)
50

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommunityToolkit/Maui のほかの issue

CommunityToolkit/Maui の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。