C# WPF设计师问题:XDG0008名称;NumericTextBoxConvertor“;命名空间中不存在“0”;clr名称空间:PulserTester.Convertors“;
我有一个错误,不能让我看到我的设计师。。但是我的构建没有错误,我的程序运行良好,没有问题 我曾尝试:C# WPF设计师问题:XDG0008名称;NumericTextBoxConvertor“;命名空间中不存在“0”;clr名称空间:PulserTester.Convertors“;,c#,wpf,xaml,mvvm,C#,Wpf,Xaml,Mvvm,我有一个错误,不能让我看到我的设计师。。但是我的构建没有错误,我的程序运行良好,没有问题 我曾尝试: 清理和重建 更新Visual Studio 修复Visual Studio 重新启动我的电脑 没有任何帮助。我不知道我还能做些什么来解决它 我必须尝试在这里查看,即使在重新启动VisualStudio、重新构建解决方案后也无法为我工作 这是我的错误: 这是Xaml文件: <Window x:Class="PulserTester.windows.ConfigPage&qu
- 清理和重建
- 更新Visual Studio
- 修复Visual Studio
- 重新启动我的电脑
<Window x:Class="PulserTester.windows.ConfigPage"
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:PulserTester.windows"
xmlns:Convertors="clr-namespace:PulserTester.Convertors"
mc:Ignorable="d"
d:DesignHeight="575.068" Width="500">
<Window.Resources>
<Convertors:NumericTextBoxConvertor x:Key="NumericTextBoxConvertor" />
</Window.Resources>
<Grid Background="White">
<StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">שם הפולסר</TextBlock>
<TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding PulserName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">האם להציג הודעה במצב של כישלון</TextBlock>
<CheckBox HorizontalAlignment="Right" IsChecked="{Binding FailQuestion,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">האם לאפשר בדיקת כיול</TextBlock>
<CheckBox HorizontalAlignment="Right" IsChecked="{Binding CalibrationOption,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">סגנון הבדיקה</TextBlock>
<ComboBox HorizontalAlignment="Right" Width="213"
ItemsSource="{Binding CheckStyles.Keys}"
SelectedItem="{Binding CheckStyleSelected,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
></ComboBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">מספר המפעל</TextBlock>
<ComboBox HorizontalAlignment="Right" Width="213"
ItemsSource="{Binding FactoriesNumbers}"
SelectedItem="{Binding FactorySelected,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
></ComboBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">תדירות השמירה בבידקות</TextBlock>
<TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding SaveBatteryFreq,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NumericTextBoxConvertor}}"></TextBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">לאפשר גבולות סטטסיטיים</TextBlock>
<CheckBox HorizontalAlignment="Right" IsChecked="{Binding AllowUsingStatistic, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">מספר התאים לתחילת הסטטסיטיקה</TextBlock>
<TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding NumberOfCellToStartTheStatistics,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource NumericTextBoxConvertor}}"></TextBox>
</StackPanel>
<StackPanel Margin="5">
<TextBlock HorizontalAlignment="Right">מספר התאים להתחול הסטטיסטיקה מחדש</TextBlock>
<TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding NumberOfCellToRestartTheStatistics,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource NumericTextBoxConvertor}}"></TextBox>
</StackPanel>
<StackPanel Margin="5">
<Button Command="{Binding Path=SaveCommand}">bb</Button>
</StackPanel>
</StackPanel>
</Grid>
</Window>
我只想重申一个提到的解决方案
.vs
文件夹
请记住,这是一个非常普遍的错误,有多种原因和解决方案,因此这可能对您不起作用,但绝对值得一试,因为我知道它在过去几次对我有效。您可以切换到另一个框架版本,然后切换回您的版本,在我的情况下,我使用的是VS16.4。我将框架从4.6.2更改为4.7.2,然后切换回4.6.2
这个简单的操作解决了我项目中的XDG0008和XDG0012。我也遇到了同样的问题。我发现,解决方案(.sln文件)中没有包含带有控件的项目。
只需将项目添加到解决方案中即可解决此问题。我过去可以通过将实际程序集名称添加到命名空间引用中来解决此问题,如下所示:
xmlns:windowManager="clr-namespace:PulserTester.Convertors;assembly=TheNameOfTheAssemblyWithoutExtension"
这在过去对我很有效。我遇到了同样的问题。我试图构建和重建我的解决方案,但没有成功。最后,我关闭了VisualStudio并重新打开了它,它被修复了 不要使用clr命名空间语法,请使用“using”,例如: 更改“clr命名空间:您的.namespace”
“使用:您的.namespace”不要为项目文件夹使用UNC路径,而是映射驱动器号。解决了相同的问题。步骤:
- 更新VisualStudio
- 关闭/打开它
- 重建
我在同一位置的Xaml问题(没有明确的转换器)与XDG0000不同,它源于OneNote将代码剪切粘贴到Xaml中 由于某种原因,粘贴的文本在有换行符的地方都以隐藏字符(确切地说是NBW)结束。通过删除控件之间的所有换行符并将控件属性放到一行上,例如:
<TransformGroup>
<ScaleTransform CenterX="0.5"
CenterY="0.5"
ScaleX="1.5"
ScaleY="1.5"/>
</TransformGroup>
到
解决了这些问题
在这里,我将此作为xaml页面
.Resources
部分中的一般问题的替代方案。我通过删除文件夹.vs/$(SolutionName)/DesignTimeBuild来解决此问题,因此我可以保留vs配置/explorer/选项卡,在删除整个.vs
时丢失的。我一直有这个问题,我的问题是我的UserControl文件中有一个事件导致错误X0008
从my UserControl中删除该Click事件并在不使用该事件的情况下进行编译将清除错误。假设所有事件都是相同的,因为不能在UserControl Xaml文件中调用它们
<UserControl x:Class="UIControls.MTRY_Button"
...
<Grid>
<Button Content = "Click Me" Height = "23"
HorizontalAlignment = "Left" Margin = "96,88,0,0" Name = "button"
VerticalAlignment = "Top" Width = "75" **Click = "button_Click"** />
</Grid>
此转换器是否与pulsertest.windows.ConfigPage
window?@vasily.sib位于同一程序集中?如果仍不工作,请关闭visual studio并删除解决方案目录中的“.vs”目录,然后重试。您可能需要显示隐藏的文件才能看到它。有时,设计者在使用缓存数据时会遇到问题。重新构建项目,它应该能够识别转换器。在执行重建时也关闭所有文件。@vasily.sib如果这是您的问题,它们位于同一项目上。.我的环境是4.6.1。我切换到4.7.2,它编译正常。谢谢你的评论,这一个有效。对我来说也是,解决了XDG0008。应标记为答案。感谢所有的支持票,但再次感谢@Bradley Uffner's.;)从2020年8月开始更新-这是唯一解决VS2019设计器错误问题的解决方案。应标记为已接受答案。工作正常,非常感谢@Bradley。这也适用于VS16.8.0预览版4
<TransformGroup>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
</TransformGroup>
<UserControl x:Class="UIControls.MTRY_Button"
...
<Grid>
<Button Content = "Click Me" Height = "23"
HorizontalAlignment = "Left" Margin = "96,88,0,0" Name = "button"
VerticalAlignment = "Top" Width = "75" **Click = "button_Click"** />
</Grid>