Geeks With Blogs
Mike Huguet I'm just talking out loud

It pains me to write this post as I feel like an idiot for having wasted my time on this “problem.”  Hopefully in posting this, I can keep some other poor lost soul working at 4 AM in the morning from spending wasteful minutes scratching his head and getting frustrated.  The Visual Studio designer will work fine in resolving namespaces, but when you build you will get the “Type or namespace ‘xyz’ does not exist error.  If you see this error please take a look at your Errors List window and ensure that you have the “Warnings” option enabled.  It is very likely that you will see that there is a missing dependent reference. 

Technorati Tags:
Posted on Monday, January 3, 2011 10:39 PM | Back to top


Comments on this post: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thankyou, just had the same problem and you gave me the answer. In addition as the application is set to "Client Profile" as the target framework, not all System.* assemblies are available to reference.
Left by Tom on Mar 16, 2011 4:09 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Brilliant - I've wasted 2 days on this problem, to discover "System.Web.Extensions" was the dependent assembly - project was set up as .NET 2.0, not .NET 3.5... *facepalm*

Thanks!
Left by Benjamin Howarth on Jun 26, 2011 5:25 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Just exactly the solution that I needed. Your post have saved a lot of time for a lot of people I believe. Thanks!
Left by Derrick on Aug 02, 2011 5:02 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thanks, you make me laugh and solved my problem, i was really getting frustrated!
Left by DiTtO on Aug 23, 2011 12:32 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thanks a lot. Really helped me alot i was stuck on this issue for last four hours.
Left by Mohsin on Oct 17, 2011 6:05 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Man, give me your address so I can send you some flowers.
Left by szm on Nov 25, 2011 6:24 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
I have a problem leading to the same symptoms:
I introduced a public abstract class AbstractView : System.Windows.Window

To use this class I have a <a:AbstractView> XAML token instead of the <Window>. And the namespace xmlns:a is set to the namespace ("clr-namespace:..."), in which both the AbstractView as well as the derived View is defined.

When I compile, everything works fine. When I start up the designer, it cannot load and two errors are displayed: The namespace and type a:AbstractView do not exist.

Obviously I cannot add a reference to the assembly, since it is the very same assembly.

Can someone please advice?
Left by Martin on Dec 15, 2011 3:27 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
UN-BE-LIEVABLE!
That was the solution to a problem I'm scratching my head for about three hours. I even rebooted my development environment. Meanwhile I searched the web and found your post. Don't feel bad for posting that - you are an angel! ;-)
Left by Torsten on Dec 26, 2011 8:12 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Glad that I could help!
Left by Mike Huguet on Dec 27, 2011 10:17 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
@Martin, I had the same problem before where I had an abstract base class for the view as you appear to have. I believe what is happening is the designer will create a new instance of the base class to render in the canvas. Because the base class is abstract it cannot create an instance of it. Try making it a standard class with a default constructor and see if that resolves it. That's at least a start.
Left by Mike Huguet on Dec 27, 2011 10:22 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Many thanks for this...I'd been trying to track down a solution to this (on and off) for WEEKS!!!
Left by Dan on Jan 10, 2012 6:52 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Who ever looks at warnings! :)

Thanks for swallowing your pride and posting.
Left by ron auger on Jan 18, 2012 1:51 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Wow, this happened to me. Thank you so much for saving my hair!
Left by Sarah on Feb 27, 2012 2:03 PM

# re Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Iam not able to understand your post..........please explain me in detail m still facing the same problem don't know what to do
Left by rakesh singh on Apr 07, 2012 5:17 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
i have this problm too,please tell me about it..
thank u

please replay me in my email.
Left by raha on Aug 22, 2012 9:00 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Man, you saved me from spending few more houres on my workplace!!! Thanks a lot!
Left by Valerii on Aug 27, 2012 8:29 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thaks a lot! (this made may monday morning!)
Left by Ingemar Nilsson on Oct 01, 2012 1:22 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thank you for the post, it still helps a lot.

God bless you!
Left by Kalpesh Popat on Nov 27, 2012 10:16 PM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Great post!

This post helped me save some hours! But I managed to wasted a couple of hours on this problem before I found this solution.

Thanks a lot!
Left by P on Dec 17, 2012 11:03 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thanks you!!
Left by JuliaVi on May 01, 2013 4:22 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thanks man!
Thanks.
Left by Siyavash on Sep 06, 2013 2:45 AM

# re: Visual Studio 2010 Type or namespace ‘xyz’ does not exist in…
Requesting Gravatar...
Thanks to you for this Post. This saved my time a loooot...
Left by Martin on Mar 14, 2014 3:22 PM

Your comment:
 (will show your gravatar)


Copyright © Mike Huguet | Powered by: GeeksWithBlogs.net