Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattleibow opened this issue Aug 27, 2024 · 3 comments
Open

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

mattleibow opened this issue Aug 27, 2024 · 3 comments
Labels
area-xaml XAML, CSS, Triggers, Behaviors delighter-sc s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@mattleibow
Copy link
Member

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

@mattleibow mattleibow added the t/bug Something isn't working label Aug 27, 2024
Copy link
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.

@dotnet-policy-service dotnet-policy-service bot added the s/triaged Issue has been reviewed label Aug 27, 2024
@mattleibow
Copy link
Member Author

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>

@samhouts samhouts added delighter-sc area-xaml XAML, CSS, Triggers, Behaviors labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-xaml XAML, CSS, Triggers, Behaviors delighter-sc s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@mattleibow @samhouts and others