469,086 Members | 1,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

Can't add a reference to namespace System.Windows.Controls

I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. I see a
System.Windows.Forms, but not a System.Windows.Controls.

Can someone let me know how I go about getting it in the list of
available references?
Thanks

Jody
Jun 27 '08 #1
17 19120
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jo******@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. I see a
System.Windows.Forms, but not a System.Windows.Controls.

Can someone let me know how I go about getting it in the list of
available references?
Do you have .NET 3.0 installed and the appropriate SDK?
System.Windows.Controls is part of WPF.

Pete
Jun 27 '08 #2
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I'm kind of new at this stuff, so i hope i'm giving you the info you
requested. I have .NET 3.5 Installed. I installed a Windows SDK, but
i'm not sure if this is the SDK you are refering to.

Jody
Jun 27 '08 #3
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I hope this isn't getting double posted (I thought i posted once, but
it didn't seem to show up).
I have .NET 3.5 installed, the only SDK's that I know that I have
installed are DirectX and Windows.
Is there a different SDK that I need?

Thanks,

Jody
Jun 27 '08 #4
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I have .NET 3.5 installed. Which SDK do I need?

Thanks,

Jody
Jun 27 '08 #5
On Jun 22, 2:06*pm, Blau <jodyb...@gmail.comwrote:
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?
Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.
Pete

I hope this isn't getting double posted (I thought i posted once, but
it didn't seem to show up).
I have .NET 3.5 installed, the only SDK's that I know that I have
installed are DirectX and Windows.
Is there a different SDK that I need?

Thanks,

Jody
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. I believe that I
have both installed.

So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?

Thanks,

Jody
Jun 27 '08 #6
On Sun, 22 Jun 2008 13:28:41 -0700, Blau <jo******@gmail.comwrote:
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. I believe that I
have both installed.
But which versions?

You can't use just any random .NET and SDK. You have to have the ones
that include WPF, which are those that support .NET 3.0 and later.
So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?
In VS2005, you'll need to install the SDK separately (VS2008 includes it,
but the SDK that comes with VS2005 doesn't include .NET 3.0 support, since
it predates that version of .NET). You can find the latest SDK that
supports WPF here:
http://www.microsoft.com/downloads/d...6-711ebe331cdc

Pete
Jun 27 '08 #7
On Jun 22, 3:13*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 13:28:41 -0700, Blau <jodyb...@gmail.comwrote:
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. *I believe that I
have both installed.

But which versions?

You can't use just any random .NET and SDK. *You have to have the ones *
that include WPF, which are those that support .NET 3.0 and later.
So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?

In VS2005, you'll need to install the SDK separately (VS2008 includes it,*
but the SDK that comes with VS2005 doesn't include .NET 3.0 support, since *
it predates that version of .NET). *You can find the latest SDK that *
supports WPF here:http://www.microsoft.com/downloads/d...D=e6e1c3df-a74...

Pete
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.

Thanks,

Jody
Jun 27 '08 #8
On Sun, 22 Jun 2008 14:25:26 -0700, Blau <jo******@gmail.comwrote:
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.
Okay, at this point we have -- assuming you are describing your situation
correctly -- determined that you have the necessary prerequisites.

So the next step is for you to be very clear about what it is exactly
you're doing, and what doesn't work about it. Describe the exact steps
you're taking, including the precise names of menu commands you're using,
etc. Tell us what you see and why that's different from what you expected
to see.

Pete
Jun 27 '08 #9
Blau <jo******@gmail.comwrote:
I have .NET 3.5 installed. Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #10
Jon Skeet [C# MVP] <sk***@pobox.comwrote:
Blau <jo******@gmail.comwrote:
I have .NET 3.5 installed. Which SDK do I need?

If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?
Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.

Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #11
On Jun 22, 3:31*pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Blau <jodyb...@gmail.comwrote:
I have .NET 3.5 installed. *Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?

Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.

Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...

--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon_skeet
C# in Depth:http://csharpindepth.com
Ya, i'm trying to use the XNA stuff from microsoft, and XNA 2.0
doesn't support 2008; So that is why i've been trying to figure it out
for 2005

Thanks,

Jody
Jun 27 '08 #12
On Jun 22, 3:36*pm, Blau <jodyb...@gmail.comwrote:
On Jun 22, 3:31*pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:


Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Blau <jodyb...@gmail.comwrote:
I have .NET 3.5 installed. *Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?
Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.
Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...
--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon_skeet
C# in Depth:http://csharpindepth.com

Ya, i'm trying to use the XNA stuff from microsoft, and XNA 2.0
doesn't support 2008; So that is why i've been trying to figure it out
for 2005

Thanks,

Jody- Hide quoted text -

- Show quoted text -
So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.

So i rightclick on the project references and go to add a reference.
It brings up a list of .net references, but they are all 2.0
references and so the namespace I want isn't there. How do I make
visual Studio 2005 look for .net 3.0 or 3.5 references?

thanks,

Jody
Jun 27 '08 #13
On Sun, 22 Jun 2008 14:43:57 -0700, Blau <jo******@gmail.comwrote:
[...]
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.
You can only use the Canvas class from WPF if that's the exact class that
the book had in mind. Otherwise, the fact that the book is using the name
"Canvas" for the class is an unfortunate coincidence, and has nothing to
do with using the WPF class.

That said...
So i rightclick on the project references and go to add a reference.
It brings up a list of .net references, but they are all 2.0
references and so the namespace I want isn't there.
What do you mean "they are all 2.0 references"? Even if you don't have
the .NET 3.0 SDK installed, you should see libraries other than 2.0. But
regardless, it's not the version of the reference that you really should
care about.

As the MSDN docs say, the Canvas class (and other WPF classes) are found
in the PresentationFramework library. So as long as you find that library
in the "Add Reference" dialog, that should be fine (my guess is that it'll
show "3.0.0.0" as the version, but even if one day that changes, the
important part will be using the correct library).
How do I make
visual Studio 2005 look for .net 3.0 or 3.5 references?
If you have the SDK correctly installed, there's nothing else for you to
do. If you don't, then you need to install the SDK correctly before the
PresentationFramework library will appear in the "Add Reference" dialog.

Pete
Jun 27 '08 #14
Blau <jo******@gmail.comwrote:
So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.
Not a good idea. Trying to use one GUI framework within a completely
different one is rarely going to work. I suggest you stick to the XNA
classes.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #15
On Sun, 22 Jun 2008 15:00:48 -0700, Jon Skeet [C# MVP] <sk***@pobox.com>
wrote:
Blau <jo******@gmail.comwrote:
>So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.

Not a good idea. Trying to use one GUI framework within a completely
different one is rarely going to work. I suggest you stick to the XNA
classes.
All due respect, IMHO that all depends on what the book's intent is.

I personally skeptical that the "canvas" class mentioned in the book is in
fact the WPF Canvas class. But, if it is, presumably the book has a
specific approach to using it that allows it to co-exist with the XNA
classes.

And more generally, as long as one follows specific rules, there's no
reason you can't mix different GUI classes. The biggest issue I see would
be making sure you don't try to share the same thread between multiple
frameworks. Taking the System.Windows.Forms and System.Windows.Controls
namespaces as an example, as long as each runs its own message dispatcher
on its own thread, the two should be able to co-exist. I presume a
similar requirement would exist trying to use XNA and WPF at the same time.

From a maintenance point of view, this approach seems, umm...non-optimal.
:) But the phrase "rarely going to work" seems correct only if you assume
that rarely would a person trying to do so understand how to do it
correctly. If that's the criteria, I think there's lots in .NET that is
"rarely going to work", given how often we see people who don't understand
how to use the various parts correctly. Our job is to help them
understand, so that these rare moments happen more often. :)

Of course, if my suspicion is correct and the book's "canvas" class has
nothing to do with WPF, then the OP isn't going to be successful with this
approach. But the reason would be that it's just the wrong "canvas"
class, not because he's trying to mix XNA and WPF.

Pete
Jun 27 '08 #16
"Blau" wrote:
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.
I realize this conversation has already taken a different direction, but for
the benefit of the people who really do need to get WPF working with VS.NET
2005, two things: first, AFAIK you can't use .NET 3.5. .NET 3.0 is possible
though, by installing the Visual Studio 2005 extensions for .NET Framework
3.0 at
http://www.microsoft.com/downloads/d...displaylang=en
.. This gets you the new file and project types in the Add New... menus and
the WPF form designer.

Hope this is of assistance to someone. :)
Jun 27 '08 #17
On Sun, 22 Jun 2008 22:27:02 -0700, Rytmis
<Ry****@discussions.microsoft.comwrote:
I realize this conversation has already taken a different direction, but
for
the benefit of the people who really do need to get WPF working with
VS.NET
2005, two things: first, AFAIK you can't use .NET 3.5.
The link I provided claims support for .NET 3.5 and compatibility with VS
2005. That seems to contradict your statement.
.NET 3.0 is possible
though, by installing the Visual Studio 2005 extensions for .NET
Framework
3.0 at
http://www.microsoft.com/downloads/d...displaylang=en
Note that that link is for a CTP. That is, a "Community Technology
Preview". From that page:

These tools are provided as an early preview of
technology being considered for the Orcas release
of Visual Studio. These tools are not supported by
Microsoft but provided as is to enable early adoption
of the .NET Framework 3.0 platform. Users will be
expected to upgrade to the Visual Studio Orcas
release when that becomes commercially available.

Why Microsoft continues to make that download available, I can't say. But
it's not something I'd use today.

Pete
Jun 27 '08 #18

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Chris | last post: by
3 posts views Thread by Poewood | last post: by
3 posts views Thread by Sushil Srivastava | last post: by
4 posts views Thread by DotNetJunkies User | last post: by
8 posts views Thread by =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.