WPF:命名空间中不存在对象

WPF:命名空间中不存在对象,wpf,namespaces,Wpf,Namespaces,我在App.xaml.cs中有一个对象,您可以在这里看到 using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using Syst

我在App.xaml.cs中有一个对象,您可以在这里看到

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace Test_Project
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //Startup
            Window main = new MainWindow();
            main.Show();
        }
    }
    /// <summary>
    /// Global values for use during application runtime
    /// </summary>
    public class runtimeObject : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string name)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }

        }
     ....

我得到的错误是,名称空间中不存在我的类。然而,xmlns:local确实引用了包含对象的名称空间,有什么想法吗

Woops,我必须进入,然后我必须重新构建解决方案

是否尝试重新构建解决方案?:尝试过,不起作用,得到同样的错误
<Application x:Class="Test_Project.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Test_Project">
    <Application.Resources>
        <local:runtimeObject x:Key="runtimeVariables" />

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles/Generic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>