Skip to content

XamlC error : Value cannot be null. (Parameter 'key') #24472

Closed

Description

@mattleibow

Description

Using this code:

https://github.com/mattleibow/scorecard-day-nft-marketplace/tree/issues/xamlc-null-key

And this command:

 *  Executing task: dotnet build -t:Run -p:Configuration=Debug -f net9.0-android -p:AdbTarget=-s%20emulator-5554 -p:AndroidAttachDebugger=true -p:AndroidSdbTargetPort=62984 -p:AndroidSdbHostPort=62984 -p:CustomAfterMicrosoftCSharpTargets="c:\Users\maleib\.vscode\extensions\ms-dotnettools.dotnet-maui-1.3.3-win32-x64\dist\resources\Custom.After.Microsoft.CSharp.targets" -p:MauiVSCodeBuildOutputFile="C:\Users\maleib\AppData\Local\Temp\dotnet-maui\maui-vsc-02d574b0-4193-4d89-99d1-f44c0a215bea.json" -p:AndroidSdkDirectory="C:\Users\maleib\android-sdk" '-p:JavaSdkDirectory="C:\Program Files (x86)\Android\openjdk\jdk-17.0.8.101-hotspot"' -p:XamlTools="c:\Users\maleib\.vscode\extensions\ms-dotnettools.csharp-2.44.19-win32-x64\.xamlTools" D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\NFTMarketplaceApp.csproj 

You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  NFTMarketplaceApp net9.0-android failed with 1 error(s) and 4 warning(s) (2,7s)
    D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml.cs(13,16): warning CS8618: Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
    D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml.cs(14,16): warning CS8618: Non-nullable property 'Type' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
    D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml.cs(16,16): warning CS8618: Non-nullable property 'Currency' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
    D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml.cs(17,16): warning CS8618: Non-nullable property 'CurrencyName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
    D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml : XamlC error : Value cannot be null. (Parameter 'key')

Build failed with 1 error(s) and 4 warning(s) in 3,1s

I get this error:

D:\GitHub\scorecard-day-nft-marketplace\NFTMarketplaceApp\ExplorePage.xaml : XamlC error : Value cannot be null. (Parameter 'key')

Steps to Reproduce

Run the command or just open in VSCode and run.

Link to public reproduction project repository

https://github.com/mattleibow/scorecard-day-nft-marketplace/tree/issues/xamlc-null-key

Version with bug

9.0.0-preview.7.24407.4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Activity

  1. added
    t/bug
    on Aug 27, 2024
  2. github-actions commented on Aug 27, 2024

    @github-actions
    Contributor

    Hi I'm an AI powered bot that finds similar issues based off the issue title.

    Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

    Open similar issues:

    Closed similar issues:

    Note: You can give me feedback by thumbs upping or thumbs downing this comment.

  3. added
    s/triaged
    on Aug 27, 2024
  4. mattleibow commented on Aug 27, 2024

    @mattleibow
    MemberAuthor

    Seems to maybe be this chunk of code:

    <CollectionView.ItemsSource>
        <x:Array Type="local:TopCollectionItem">
            <local:TopCollectionItem
                Name="Bear Baron"
                Type="Art Collection" />
            <local:TopCollectionItem />
            <local:TopCollectionItem />
            <local:TopCollectionItem />
            <local:TopCollectionItem />
            <local:TopCollectionItem />
        </x:Array>
    </CollectionView.ItemsSource>
  5. added
    area-xaml
    on Aug 27, 2024
  6. added this to the Backlog milestone on Dec 5, 2024
  7. added a commit that references this issue on Nov 28, 2025
    8b85013
  8. added a commit that references this issue on Nov 28, 2025
    baa9851
  9. locked and limited conversation to collaborators on Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-xamldelighter-scs/triagedt/bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions