【问题标题】:WPF designer can't be loaded when using x64使用 x64 时无法加载 WPF 设计器
【发布时间】:2012-02-13 07:25:44
【问题描述】:

使用 x86 时 WPF Designer 加载成功,但使用 x64 时出现这样的错误:

错误 1 ​​未定义的 CLR 命名空间。 “clr-namespace” URI 指的是程序集中未包含的命名空间“TerminatorConsole2.View”。 C:\Oleg\projects\MBClient\TerminatorConsole2\View\StrategyView.xaml 5 12 TerminatorConsole2

有什么问题以及如何解决?

<UserControl 
  x:Class="TerminatorConsole2.View.StrategyView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vw="clr-namespace:TerminatorConsole2.View"          <------ problem line
  HorizontalAlignment="Center"
  VerticalAlignment="Center"  
  Width="1328" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="562">
...............

【问题讨论】:

  • 能否请您添加 xaml 文件列表及其代码隐藏?
  • 添加了 xaml 代码。后面的代码是默认的 - 只需调用 InitializeComponent()
  • 请确保StrategyView 类(代码隐藏)在TerminatorConsole2.View 命名空间中定义。

标签: c# wpf


【解决方案1】:

猜测。 Visual Studio 是一个 32 位应用程序,它不能正确加载 x64 dll :)

【讨论】:

    【解决方案2】:

    尝试重建解决方案,错误可能会消失。另请查看其他食谱:The 'clr-namespace' URI refers to a namespace that is not included in the assembly

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-15
      • 2011-10-16
      • 1970-01-01
      • 2012-07-13
      • 2014-05-23
      • 1970-01-01
      • 2014-02-24
      • 2017-10-17
      相关资源
      最近更新 更多