Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Control Not Found in Namespace but App Compiles Fine

17 Nov 2014 1  
How to fix this ANNOYING problem

Introduction

I like using the WPF designer, mostly because I can see the layout of the window/control. However, for some reason that has haunted Visual Studio since the 2008 version (when WPF was initially introduced), the IDE and compiler don't play nice with each other, where the IDE sometimes insists that a given control can't be found in the specified namespace, yet the compiler builds the application successfully - while still generating errors complaining about being unable to resolve the control's parent namespace. This error renders the IDE designer all but useless. I tried a number of things involving the xmlns definition in the XAML file, all to no avail.

MY solution was to delete the control from the XAML in which it was being used (along with its associated xmlns definition, and then re-add the control from the Toolbox.

Doing this one time for just one control fixed all instances of the namespace error, and I can now design visually once again in the problem form.

There is no code associated with this tip.

Update - 03 June 2015

I found that my REAL problem is that if a solution/project is on a network share, the WPF designer chokes and pukes on namespace resolution for user controls. To my knowledge, there is no fix. Curiously, the same problem does not seem to occur for converters.

I wouldn't hold my breath waiting for a fix for this. It's been a problem since WPF was born, and we're four Visual Studio versions down the road with no fix in sight.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here