Visual Studio 2013 Express WPF Deigner 加载失败 [英] Visual Studio 2013 Express WPF Deigner load failure

查看:30
本文介绍了Visual Studio 2013 Express WPF Deigner 加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 VS2013 Express Wpf 设计器有问题.他不会加载我使用自定义转换器的视图.应用程序编译并运行良好,我的转换器按预期工作.但是在设计模式下,我不断收到名称{converterClassName} 在名称空间{namespace} 中不存在"

I have troubles with my VS2013 Express Wpf Designer. He won't load the views in wich I use Custom converters. The application compile and run fine and my converters work as expected. But in design mode, I keep getting "The name {converterClassName} does not exist in the namespace {namespace}"

事情是,虽然我不使用设计器来创建视图,但我使用它来了解我正在做的事情会是什么样子而无需调试,所以如果它可以工作,我会非常高兴再次.

Thing is, while I don't use the designer to create the view, I use it to have an idea of what I am doing will look like without having to debug, so I'll be super glad if it could work again.

全局视图:

(原谅我的法国人)

详情:

我引用我的命名空间(以这种方式与视图属于同一个程序集:

I reference my namespace (wich belongs to the same assembly than the view this way :

<UserControl xmlns:converters="clr-namespace:Sequenceur.ProdUI.IHM.Converters">

以这种方式声明资源:

<UserControl.Resources>
    <converters:BoolToVisibility x:Key="visibilityConverter"/>
</UserControl.Resources>

(问题与窗口相同)

并以这种方式使用我的转换器:

And use my converter this way :

<MenuItem Header="Maintenance" Visibility="{Binding Path=AdminMode, Converter={StaticResource ResourceKey=visibilityConverter}}">

转换器本身

这是一个简单的 IValueConverter 实现,没什么特别的.

It's a simple IValueConverter realization, nothing fancy.

在我所有的其他项目中,即使使用转换器,设计器也能很好地加载.你可能想知道我从另一个项目中根据我的观点做了一些肮脏的副本/过去,它一定来自那个,但我看不到哪里......

In all my other projects, the designer load just fine even with converters. You may like to know that I have made some dirty copy/past with my view from an other project, it must come from that, but i can't see where...

推荐答案

我在 VS 2012 中遇到了类似的问题,包括转换器以及来自 resx 文件的资源.恐怕我没有每次都有效的解决方案,但可以从类似的问题中启发自己,例如 这个这个,我通常在解决方案配置Debug 86"和Debug Any CPU"之间切换几次,清理和重建直到问题消失(它并不总是第一个工作时间).

I have had similar problems with VS 2012, for converters as well as for resources from resx files. I'm afraid I don't have a solution that works every time, but inspiring myself from similar questions such as this one and this one, I usually switch between solution configuration "Debug 86" and "Debug Any CPU" a couple of times, cleaning and rebuilding till the problem goes away (it doesn't always works the first time).

如果这不起作用,上面链接中的答案提到了我还没有亲自尝试过的其他解决方案,包括将程序集信息添加到 clr 命名空间或更改输出路径.

If that doesn't work, the answers in the above link mention other solutions which I haven't personnaly tried, including adding the assembly information to the clr-namespace or changing the output path.

我还看到了一个解决方案,其中包括创建一个新项目来消除错误,但由于这些错误往往会反复出现,因此它只是一个临时解决方案(而且很烦人,尤其是在使用源代码时)控制).

I have also seen the solution which consists of creating a new project to get rid of the error but as these errors tend to be recurring, it is a temporary solution only (and an annoying one at that, especially when working with source control).

这篇关于Visual Studio 2013 Express WPF Deigner 加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆