At least one Choice element must be included in an AlternateContent element

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The AlternateContent element requires at least one Choice element.

This error is raised when the file is a valid XML document, but is not a well-formed XAML document.

Error ID: XAML0406

Note Note

This error message also applies to the Silverlight Designer.

To correct this error

  • Insert a Choice element as a child of the AlternateContent element.

The following code example shows how to define fallback content with the AlternateContent element. Remove the Choice element to raise error XAML0406.


        <DockPanel xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006'
		xmlns:v1='assembly.v1'
		xmlns:v2='assembly.v2'
		mc:Ignorable="v2" >

            <mc:AlternateContent>
                <!-- Comment out the following Choice element to raise error XAML0406. -->
                <mc:Choice Requires='v2'>
                    <Button Content='V2' />
                </mc:Choice>
                <mc:Fallback>
                    <Button Content='V1'/>
                </mc:Fallback>
            </mc:AlternateContent>

        </DockPanel>


Show: