I'm creating a multi-page WPF application, which uses the MVVM model to navigate between pages. All views, models, and viewmodels are created and named accordingly, none of which should be overlapping.
Upon building, App.xaml throws these errors:
XDG0008 The name "AscentView" does not exist in the namespace "clr-namespace:Valorant_Lineup_Library.MVVM.View"
XLS0414 The type 'view:AscentView' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The tag 'AscentView' does not exist in XML namespace 'clr-namespace:Valorant_Lineup_Library.MVVM.View'. Line 15 Position 18.
Each class appears properly in those namespaces, and I can't determine how this could be happening. Below I'll leave the snippets of my code relating to these issues.
MainWindow.xaml
<Window x:Class="Valorant_Lineup_Library.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="clr-namespace:Valorant_Lineup_Library.MVVM.ViewModel"
xmlns:local="clr-namespace:Valorant_Lineup_Library"
mc:Ignorable="d"
Height="600" Width="920"
WindowStyle="None"
Background="Transparent"
AllowsTransparency="True">
<Window.DataContext>
<viewModel:MainViewModel/>
</Window.DataContext>
<Border Background="Black">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ContentControl Grid.Row="1"
Grid.Column="1"
Margin="10"
Content="{Binding CurrentView}"/>
</Grid>
</Border>
</Window>
App.xaml (Edit: removed trailing assembly=
from ViewModel
namespace. Was leftover from previous attempts to resolve issue.)
<Application x:Class="Valorant_Lineup_Library.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Valorant_Lineup_Library"
xmlns:viewModel="clr-namespace:Valorant_Lineup_Library.MVVM.ViewModel"
xmlns:view="clr-namespace:Valorant_Lineup_Library.MVVM.View"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<DataTemplate DataType="{x:Type viewModel:AscentViewModel}">
<view:AscentView/>
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>
MVVM/View/AscentView.xaml Namespaces (created as UserControl)
<UserControl x:Class="Valorant_Lineup_Library.MVVM.View.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Valorant_Lineup_Library.MVVM.View"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
</UserControl>
I apologize if this is a lot to look at but I greatly appreciate any help! Also, I was loosely following this video as I was creating the application if this is any help: https://www.youtube.com/watch?v=PzP8mw7JUzI&t=848s
I'm unable to comment as I don't have enough reputation for it, and I'm not sure if this will help ,but I had this problem often when I started with View Models and what fixed it for me was rebuilding the Solution and making sure the view models are public, and then the error would go away.