PC Review


Reply
Thread Tools Rate Thread

Cannot find the System.Windows.Forms assembly

 
 
nr0mx.g@googlemail.com
Guest
Posts: n/a
 
      18th Feb 2007
I am trying to build a WinForms application, and I'm using the Visual
Studio C# 2005 Express edition. Doesn't it bind to .NET 2.0 by
default, and shouldn't it be able to find the dll without any settings
being tweaked ? I'm sure the answer is simple, but I couldn't find
anything after a brief trawl of the net.

nr0mx.

 
Reply With Quote
 
 
 
 
RobinS
Guest
Posts: n/a
 
      18th Feb 2007

"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am trying to build a WinForms application, and I'm using the Visual
> Studio C# 2005 Express edition. Doesn't it bind to .NET 2.0 by
> default, and shouldn't it be able to find the dll without any settings
> being tweaked ? I'm sure the answer is simple, but I couldn't find
> anything after a brief trawl of the net.
>
> nr0mx.
>


What do you mean bind to .Net 2.0? Visual Studio 2005 (in any flavor or
version) does use the .Net 2.0 framework. I don't understand what you mean
when you say "find the dll". The .Net framework is made up of lots of
dll's. Can you be more specific as to what you are trying to do that is not
working?

Robin S.


 
Reply With Quote
 
nr0mx.g@googlemail.com
Guest
Posts: n/a
 
      18th Feb 2007
On Feb 18, 8:22 am, "RobinS" <Rob...@NoSpam.yah.none> wrote:
> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message
>
> news:(E-Mail Removed)...
>
> >I am trying to build a WinForms application, and I'm using the Visual
> > Studio C# 2005 Express edition. Doesn't it bind to .NET 2.0 by
> > default, and shouldn't it be able to find the dll without any settings
> > being tweaked ? I'm sure the answer is simple, but I couldn't find
> > anything after a brief trawl of the net.

>
> > nr0mx.

>
> What do you mean bind to .Net 2.0? Visual Studio 2005 (in any flavor or
> version) does use the .Net 2.0 framework. I don't understand what you mean
> when you say "find the dll". The .Net framework is made up of lots of
> dll's. Can you be more specific as to what you are trying to do that is not
> working?
>
> Robin S.



Sorry, I wasn't clear enough. This is the code I'm trying to compile:
using System;
using System.Windows.Forms;

namespace WinFormsTest
{
class SimpleHelloWord: Form
{
[STAThread]
public static int Main(string[] args)
{
Application.Run(new SimpleHelloWord());
return 0;
}

public SimpleHelloWord()
{
this.Text = "Hello World";
}
}
}

Compilation fails at the second line .. "The type or namespace name
'Windows' does not exist in the namespace 'System' (are you missing an
assembly reference?)". I assume this is because it cannot find the
System.Windows.Forms dll. However if this ships with .NET 2.0 by
default, and VS C# 2005 Express Edition uses the 2.0 framework, where
am I going wrong ? Been scratching my head!

nr0mx.

 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      18th Feb 2007
(E-Mail Removed) wrote:
> On Feb 18, 8:22 am, "RobinS" <Rob...@NoSpam.yah.none> wrote:
>> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>>> I am trying to build a WinForms application, and I'm using the Visual
>>> Studio C# 2005 Express edition. Doesn't it bind to .NET 2.0 by
>>> default, and shouldn't it be able to find the dll without any settings
>>> being tweaked ? I'm sure the answer is simple, but I couldn't find
>>> anything after a brief trawl of the net.
>>> nr0mx.

>> What do you mean bind to .Net 2.0? Visual Studio 2005 (in any flavor or
>> version) does use the .Net 2.0 framework. I don't understand what you mean
>> when you say "find the dll". The .Net framework is made up of lots of
>> dll's. Can you be more specific as to what you are trying to do that is not
>> working?
>>
>> Robin S.

>
>
> Sorry, I wasn't clear enough. This is the code I'm trying to compile:
> using System;
> using System.Windows.Forms;
>
> namespace WinFormsTest
> {
> class SimpleHelloWord: Form
> {
> [STAThread]
> public static int Main(string[] args)
> {
> Application.Run(new SimpleHelloWord());
> return 0;
> }
>
> public SimpleHelloWord()
> {
> this.Text = "Hello World";
> }
> }
> }
>
> Compilation fails at the second line .. "The type or namespace name
> 'Windows' does not exist in the namespace 'System' (are you missing an
> assembly reference?)". I assume this is because it cannot find the
> System.Windows.Forms dll. However if this ships with .NET 2.0 by
> default, and VS C# 2005 Express Edition uses the 2.0 framework, where
> am I going wrong ? Been scratching my head!
>
> nr0mx.
>


You need to add a reference to the system.windows.forms.dll to your project.

This is done automatically if you create a windows application project,
so you have to have created a different kind of project.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
nr0mx.g@googlemail.com
Guest
Posts: n/a
 
      18th Feb 2007
On Feb 18, 9:50 pm, Göran Andersson <g...@guffa.com> wrote:
> nr0m...@googlemail.com wrote:
> > On Feb 18, 8:22 am, "RobinS" <Rob...@NoSpam.yah.none> wrote:
> >> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message

>
> >>news:(E-Mail Removed)...

>
> >>> I am trying to build a WinForms application, and I'm using the Visual
> >>> Studio C# 2005 Express edition. Doesn't it bind to .NET 2.0 by
> >>> default, and shouldn't it be able to find the dll without any settings
> >>> being tweaked ? I'm sure the answer is simple, but I couldn't find
> >>> anything after a brief trawl of the net.
> >>> nr0mx.
> >> What do you mean bind to .Net 2.0? Visual Studio 2005 (in any flavor or
> >> version) does use the .Net 2.0 framework. I don't understand what you mean
> >> when you say "find the dll". The .Net framework is made up of lots of
> >> dll's. Can you be more specific as to what you are trying to do that is not
> >> working?

>
> >> Robin S.

>
> > Sorry, I wasn't clear enough. This is the code I'm trying to compile:
> > using System;
> > using System.Windows.Forms;

>
> > namespace WinFormsTest
> > {
> > class SimpleHelloWord: Form
> > {
> > [STAThread]
> > public static int Main(string[] args)
> > {
> > Application.Run(new SimpleHelloWord());
> > return 0;
> > }

>
> > public SimpleHelloWord()
> > {
> > this.Text = "Hello World";
> > }
> > }
> > }

>
> > Compilation fails at the second line .. "The type or namespace name
> > 'Windows' does not exist in the namespace 'System' (are you missing an
> > assembly reference?)". I assume this is because it cannot find the
> > System.Windows.Forms dll. However if this ships with .NET 2.0 by
> > default, and VS C# 2005 Express Edition uses the 2.0 framework, where
> > am I going wrong ? Been scratching my head!

>
> > nr0mx.

>
> You need to add a reference to the system.windows.forms.dll to your project.
>
> This is done automatically if you create a windows application project,
> so you have to have created a different kind of project.
>
> --
> Göran Andersson
> _____http://www.guffa.com- Hide quoted text -
>
> - Show quoted text -


D'oh! That was it. Many thanks.

nr0mx

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find row/column of a System.Windows.Forms.ListView MouseDoubleClick event viepia Microsoft C# .NET 0 27th Aug 2008 02:21 AM
using System.Windows.Forms - can't find namespace? garyusenet@myway.com Microsoft C# .NET 9 13th Dec 2006 08:42 PM
where to find system.windows assembly Dica Microsoft C# .NET 5 14th Oct 2005 06:09 PM
How do I know System.Windows.Forms.TextBox in System.Windows.Forms lose Active? Frank Lee Microsoft Dot NET Framework 3 6th May 2005 01:20 PM
File or assembly name System.Windows.Forms error in Visual Studio.NET Beta 2. Andrzej Wegrzyn Microsoft Dot NET Framework 1 29th Aug 2003 11:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:34 PM.