"element not found" = 0x8000490

1

I'm learning XAML and universal windows apps at the moment. I've encountered an issue where I get an element not found (exception from HRESULT:0x80070490) and I can't seem to figure out where exactly that error is referring to. If I double click on it, VS opens the MainPage.xaml where <Page is underlined with the error.

It's nothing special... Just a collection of a few controls to play with.

<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid>
    <Grid.Background>
        <ImageBrush Stretch="Fill" ImageSource="Assets/320x480-1.jpg"/>
    </Grid.Background>

    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="77,23,68,24">
        <TextBox x:Name="HelloMessage" Text="Hello, World!" Margin="10" IsReadOnly="True"/>
        <Button x:Name="ClickMe2" Content="Click Me!"  Margin="10" HorizontalAlignment="Center" Click="ClickMe2_Click"/>
        <Slider x:Name="slider" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Top" Width="100" BorderThickness="0,50,0,0"/>
    </StackPanel> 
</Grid>

This is the exact error as copied from VS.

Severity    Code    Description Project File    Line    Suppression State
Error       Element not found. (Exception from HRESULT: 0x80070490) Control D:\Dev\TestUW\App1\App1\MainPage.xaml   1   

I tried removing the grid and the error persisted. I also verified that App1.MainPage existed as well. How can I figure out what exactly it's complaining about?

c#
xaml
win-universal-app
uwp
asked on Stack Overflow Dec 13, 2015 by Zonus • edited Dec 14, 2015 by Romasz

2 Answers

1

Too late now, but I ran into the same problem, copying the code from the MS OpenCV sample link (https://developer.microsoft.com/en-us/windows/iot/samples/opencv)

The problem was that you needed a space " " before the end of the first "page" tag. So instead of the code reading:

mc:Ignorable="d"> <-- missing space after "d"

it should read:

mc:Ignorable="d" > 
answered on Stack Overflow Dec 22, 2016 by Brian
0

Well the first thing i noticed is that your Page Tag is not closed or You just didn't copied that.Usually element not found could be caused due to calling something too early..You might consider using On_Loaded. If the problem is only that you haven't closed your Page tag make sure to do it after the Grid one ..

answered on Stack Overflow Dec 13, 2015 by QuestionsEverywhere

User contributions licensed under CC BY-SA 3.0