0

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.

Global View :

enter image description here

(Pardon my Frenchiness)


Details :

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

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

Declare the ressource this way :

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

(The problem is the same with a Window)

And use my converter this way :

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

The converter itself

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...

daniele3004
  • 13,072
  • 12
  • 67
  • 75
IronSlug
  • 492
  • 3
  • 15

2 Answers2

0

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).

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).

Community
  • 1
  • 1
cmousset
  • 625
  • 7
  • 21
  • Ok, so it come from VS designer flaws and there is no generic solution. Anyway, thanks for the tips. Here are your points. – IronSlug Oct 09 '14 at 14:23
  • Well, maybe there's a perfectly rational way to solve this, but I haven't found it yet. I hoped it would be solved in the 2013 version, but it seems not. It seems to me that by sticking to x86, the issue occurs less frequently. Bon courage ! – cmousset Oct 09 '14 at 15:30
0

Fighting with Visual Studio designer is very common, in my case especially. Sometimes I'm on the edge of madness and that's the reason why I prefer only code view and not using designer (but of course, designes has some advantages). But in your case, these steps should help :

  1. rebuild solution (BoolToVisibility is maybe not built)
  2. close your XAML file
  3. try to clean and rebuild second time
  4. open your XAML file

Maybe it won't help. Sometimes restarting of the Visual Studio can solve some of these issues as well.

y0j0
  • 3,369
  • 5
  • 31
  • 52