What does this error mean?

Jul 23, 2011 at 6:33 AM
Edited Jul 23, 2011 at 7:17 AM

System.Generic.KeyNotFoundException: The given key was not present in the dictionary.

And a sample item:

 

		<Item Id="1" Name="Adventurer" Img="images/adventurer.jpg">
			<Facet Name="Set"><String Value="Base"/></Facet>
			<Facet Name="Type"><String Value="Action"/></Facet>
			<Facet Name="Cost"><String Value="6"/></Facet>
			<Facet Name="Actions"><Number Value="0"/></Facet>
			<Facet Name="Cards"><Number Value="0"/></Facet>
			<Facet Name="Money"><Number Value="0"/></Facet>
			<Facet Name="Buys"><Number Value="0"/></Facet>
			<Facet Name="Victory Points"><Number Value="0"/></Facet>
			<Facet Name="Card Text"><LongString Value="Reveal cards from your deck until you reveal 2 Treasure cards. Put those Treasure cards into your hand and discard the other revealed cards."/></Facet></Item>

 

Note the file I am processing has had the facet categories temporarily deleted as I was getting an error telling me the "=" sign was not a valid value?

This is as far as the DeepZoom file gets:

<?xml version="1.0" encoding="utf-8"?>
<Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.microsoft.com/livelabs/pivot/collection/2009" Name="Published Dominion Cards" SchemaVersion="1.0" xmlns="http://schemas.microsoft.com/collection/metadata/2009">
    <Items ImgBase="cards-dz_deepzoom\cards-dz.dzc" />
</Collection>

Any help?

Jul 24, 2011 at 5:55 AM

OK....

 

Today I did find some errors in my XML file. I corrected those and have validated the XML with my editors validation tool and the W3C online validator. I still get the same KeyNotFoundException error.

 

The out put now makes it to this state:

<?xml version="1.0" encoding="utf-8"?>
<Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.microsoft.com/livelabs/pivot/collection/2009" Name="Published Dominion Cards" SchemaVersion="1.0" xmlns="http://schemas.microsoft.com/collection/metadata/2009">
    <FacetCategories>
        <FacetCategory Name="Set" Type="String" p:IsFilterVisible="true" p:IsMetaDataVisible="true" p:IsWordWheelVisible="true">
            <Extension>
                <p:SortOrder Name="Set">
                    <p:SortValue Value="Base" />
                    <p:SortValue Value="Intrigue" />
                    <p:SortValue Value="Seaside" />
                    <p:SortValue Value="Alchemy" />
                    <p:SortValue Value="Prosperity" />
                    <p:SortValue Value="Cornucopia" />
                    <p:SortValue Value="Promo" />
                    <p:SortValue Value="Common" />
                </p:SortOrder>
            </Extension>
        </FacetCategory>
        <FacetCategory Name="Type" Type="String" p:IsFilterVisible="true" p:IsMetaDataVisible="true" p:IsWordWheelVisible="true">
            <Extension>
                <p:SortOrder Name="Type">
                    <p:SortValue Value="Action" />
                    <p:SortValue Value="Action-Reaction" />
                    <p:SortValue Value="Action-Attack" />
                    <p:SortValue Value="Action-Victory" />
                    <p:SortValue Value="Action-Duration" />
                    <p:SortValue Value="Action-Prize" />
                    <p:SortValue Value="Action-Attack-Prize" />
                    <p:SortValue Value="Victory" />
                    <p:SortValue Value="Treasure" />
                    <p:SortValue Value="Treasure-Victory" />
                    <p:SortValue Value="Curse" />
                    <p:SortValue Value="Treasure-Prize" />
                </p:SortOrder>
            </Extension>
        </FacetCategory>
    </FacetCategories>
    <Items ImgBase="cards-dz_deepzoom\cards-dz.dzc" />
</Collection>
What else could I be doing wrong here?

Jul 24, 2011 at 5:21 PM

I think I've finally found all my issues.

 

For future reference for any other newbie stumbling in here.

 

Every facet must have a facet category (KeyNotFoundError>

In a self closing tag (i.e. <p:SourceValue Value="x" />), make sure you insert a space before the closing backslash.