the name <...> does not exist in the namespace clr-namespace <...>

In addition to the "does not exist in the namespace" message, I was also getting a message from the designer that it could not display the window for x64 and ARM targets.

I have just found that switching the build to x86 mode, doing a rebuild solution, then switching back to x64 mode and then rebuilding again fixes [both] problems.

Simply rebuilding the x64 solution did nothing.


This is what worked for me on Visual Studio 2012 (Update 3).

  • Restart Visual Studio
  • Add current assembly to namespace declaration xmlns:framework="clr-namespace:TimeRecorder.Framework;assembly=MyAssembly
  • Build -> Build Solution

Every time it happend to me i just restarted visual studio, re-built the solution and it worked just fine.. can't say why


What I found that helped (especially if this error occurs in App.xaml) is to comment out the reference(s) that gives you trouble, rebuild, then uncomment. I think what this does is allows the entire project to actually build instead of stopping the build at the error.

From what I can gather, the app is trying to build the files in a certain order, so when App.xaml or presumably any other class file errors in a reference, the file that is causing the error hasn't been compiled correctly, hence why it doesn't find the file in that namespace.