Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 域名出现两次错误_C#_.net_Wpf - Fatal编程技术网

C# 域名出现两次错误

C# 域名出现两次错误,c#,.net,wpf,C#,.net,Wpf,我创建了一个WPF窗口,如下所示: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ReVVed" x:Class="ReVVed.Merge_Text_Window" MinWidth="400" Min

我创建了一个WPF窗口,如下所示:

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ReVVed" x:Class="ReVVed.Merge_Text_Window"
    MinWidth="400" MinHeight="400" Width="600" Height="400" WindowStyle="ToolWindow" Title="Merge Text" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">

我编译了代码并进行了尝试,但当我返回并添加了一个窗口加载的事件处理程序时,我开始出现以下错误:

类型“ReVVed.ReVVed”中不存在类型名“Merge\u Text\u Window”

我不知道正在调查什么。错误引用了第4行第22列,这是最小宽度声明。我的代码中没有ReVVed.ReVVed命名空间。我不会编译


有什么想法吗?

在类复制已指定的本地名称空间之前,您是否尝试过这样做,因为消息暗示了名称空间

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ReVVed" x:Class="Merge_Text_Window"
    MinWidth="400" MinHeight="400" Width="600" Height="400" WindowStyle="ToolWindow" Title="Merge Text" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">


不确定它为什么工作,但我将窗口和代码隐藏放在一个单独的名称空间中,而不是放在项目名称空间下,它现在可以正常编译。

是的,如果我在类声明中省略名称空间,则代码隐藏中的所有函数和变量“在当前上下文中不存在”。