Click here to Skip to main content
15,884,643 members
Articles / Desktop Programming / WPF
Tip/Trick

Control Not Found in Namespace but App Compiles Fine

Rate me:
Please Sign up or sign in to vote.
4.00/5 (3 votes)
17 Nov 2014CPOL1 min read 9.1K   2
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Paddedwall Software
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.

Comments and Discussions

 
GeneralMy vote of 2 Pin
KarstenK18-Nov-14 0:27
mveKarstenK18-Nov-14 0:27 
GeneralRe: My vote of 2 Pin
Phil J Pearson24-Nov-14 0:12
Phil J Pearson24-Nov-14 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.