3

I am working on coding a GUI with C#. I'm following this simple tutorial to get started. To compile, I need to reference System.Windows.Forms.DLL System.Drawing.DLL, so I type

csc /r:System.Windows.Forms.DLL /r:System.Drawing.DLL FirstForm.cs

However, I get errors like this:

FirstForm.cs(6,14): error CS0012: The type 'System.ComponentModel.Component' is
    defined in an assembly that is not referenced. You must add a reference
    to assembly 'System, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089'.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Windows.Forms.dll:
    (Location of symbol related to previous error)

I've already added "c:\Windows\Microsoft.NET\Framework\v4.0.30319" to my path. I don't know why it's telling me to reference it when I already have.

Veech
  • 1,397
  • 2
  • 12
  • 20
  • 1
    Why not use Visual Studio Express for this? – Oded Jun 15 '12 at 19:44
  • 1
    Yea, download it dude. Working with command line is a nightmare. – apocalypse Jun 15 '12 at 19:46
  • 1
    @Veech - jonnyGold is correct: "/r:System.dll" should help. Oded and zgnilec are even *MORE* correct - you absolutely, totally, completely need to get a copy of MSVS. For example, the free Visual Studio Express from [here](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express). – paulsm4 Jun 15 '12 at 19:47
  • If you want to use a open source IDE, check out [Sharp Develop](http://www.icsharpcode.net/OpenSource/SD/) – bluevector Jun 15 '12 at 20:18
  • If you really want to code C#, you're probably going to be doing most of it on Microsoft. Do yourself a favor, and get MSVS. I would *not* mess around with MonoDevelop, SharpDevelop or anything besides Microsoft VS unless I had a very, very good reason. IMHO... – paulsm4 Jun 15 '12 at 20:34

1 Answers1

8

You need to add /r:System.DLL to your command line arguments

bluevector
  • 3,485
  • 1
  • 15
  • 18