Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

Cannot find the System.Windows.Forms assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nr0mx.g@googlemail.com - 17 Feb 2007 23:45 GMT
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.
RobinS - 18 Feb 2007 07:22 GMT
>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
[quoted text clipped - 3 lines]
>
> 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.
nr0mx.g@googlemail.com - 18 Feb 2007 20:47 GMT
> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message
>
[quoted text clipped - 15 lines]
>
> 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.
Göran Andersson - 18 Feb 2007 21:50 GMT
>> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message
>>
[quoted text clipped - 44 lines]
>
> 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.

Signature

Göran Andersson
_____
http://www.guffa.com

nr0mx.g@googlemail.com - 18 Feb 2007 22:06 GMT
> nr0m...@googlemail.com wrote:
> >> "nr0m...@googlemail.com" <nr0...@googlemail.com> wrote in message
[quoted text clipped - 56 lines]
>
> - Show quoted text -

D'oh! That was it. Many thanks.

nr0mx

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.