impyre
impyre

Reputation: 87

Why can't my c# compiler find System.Windows.Forms

Here's the basic information:

  1. I've been studying Rob Miles' C# Yellow Book 2011 extensively.
  2. I'm on page 155 of 197 (mostly finished) and coming to the part about forms/guis.
  3. I use Notepad++ and NppExec for quick compiling and easy editing (I just personally loathe VisualStudio... I don't like having things done for me.)
  4. I'm using .NET 4.0's compiler
  5. I've set up csc.rsp to include:
    1. System.Windows.Forms.dll
    2. System.Drawing.dll
    3. System.Drawing.Design.dll
    4. and the other required resource references.
  6. I've double-checked all my references.
  7. I include all required "using" statements in my code.

And the problem:

Every time I try to compile a piece of code which makes use of any form methods I get this error:

error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

I've looked everywhere. What can I do to resolve this issue?

PS - if you really want or need to see the code, I can paste it in a response. I won't do it unless someone asks because it's kinda long.

Upvotes: 2

Views: 1169

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1063015

If it can't find Windows under System, then your reference to System.Windows.Forms.dll isn't working. You don't show exactly how you are doing that, but: that is the problem. So: however you are using csc.rsp, it isn't working. Are you perhaps using /noconfig? Have you edited the right file? Did you edit it as an admin user? If you open csc.rsp in an editor, are your changed there?

Upvotes: 5

Related Questions