Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Compilation problem with WinForms

You still have some missing references. Adding a reference to System.Dll and
Microsoft.Win32.Interop.Dll should fix the problems you see here. WinDes
uses a pretty complete list of references when it compiles. It's quite
unlikely that you'll need all of them, but I don't think there's any harm in
adding them.

/R:"mscorlib.dll"
/R:"System.Web.DLL"
/R:"System.Net.DLL"
/R:"System.Data.DLL"
/R:"System.DirectoryServices.DLL"
/R:"Microsoft.Win32.Interop.DLL"
/R:"System.Configuration.Install.DLL"
/R:"System.DLL"
/R:"System.Web.Services.DLL"
/R:"System.WinForms.DLL"
/R:"System.Diagnostics.DLL"
/R:"System.Text.RegularExpressions.DLL"
/R:"System.Messaging.DLL"
/R:"System.Timers.DLL"
/R:"System.ServiceProcess.DLL"
/R:"System.Drawing.DLL"
/R:"System.Data.Design.DLL

Also, the following site has some utilities that might help in this regard:

http://www.razorsoft.net

Hope that helps.

Regards,
Dan

"Ran Kornfeld" <rankorn@internet-zahav.net> wrote in message
news:39aa5b35@news.dev-archive.com...
> Hello
> I am tring to compile the simple Hello World winforms version but I get
the
> following error:
> error CS0234: The type or namespace name 'WinForms' does not exist in the
> class or namespace 'System'
>
> When I put a "/r:System.WinForms.dll" as a compiler parameter I get others
> strange errors as:
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.Control' has unknown
> base class or interface 'System.ComponentModel.MarshalByRefComponent'
>
> and
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.RichControl' has unk
> nown base class or interface 'Microsoft.Win32.Interop.IOleControl'
>
> What is the problem?
>
> --
> Ran kornfeld
> rankorn@bezeqint.net
>
>
>
>
>
[2161 byte] By [Daniel Pratt] at [2007-11-9 18:21:48]
# 1 Re: Compilation problem with WinForms
Hello
I am tring to compile the simple Hello World winforms version but I get the
following error:
error CS0234: The type or namespace name 'WinForms' does not exist in the
class or namespace 'System'

When I put a "/r:System.WinForms.dll" as a compiler parameter I get others
strange errors as:

System.WinForms.dll: error CS0011: Referenced class
'System.WinForms.Control' has unknown
base class or interface 'System.ComponentModel.MarshalByRefComponent'

and

System.WinForms.dll: error CS0011: Referenced class
'System.WinForms.RichControl' has unk
nown base class or interface 'Microsoft.Win32.Interop.IOleControl'

What is the problem?

--
Ran kornfeld
rankorn@bezeqint.net
Ran Kornfeld at 2007-11-11 22:29:04 >
# 2 Re: Compilation problem with WinForms
Ran, I got it to work by referencing WinForms as follows in the command
line:
/r:\winnt\complus\v2000.14.1812\System.WinForms.dll

Regards,
Tom Dacon

"Ran Kornfeld" <rankorn@internet-zahav.net> wrote in message
news:39aa5b35@news.dev-archive.com...
> Hello
> I am tring to compile the simple Hello World winforms version but I get
the
> following error:
> error CS0234: The type or namespace name 'WinForms' does not exist in the
> class or namespace 'System'
>
> When I put a "/r:System.WinForms.dll" as a compiler parameter I get others
> strange errors as:
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.Control' has unknown
> base class or interface 'System.ComponentModel.MarshalByRefComponent'
>
> and
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.RichControl' has unk
> nown base class or interface 'Microsoft.Win32.Interop.IOleControl'
>
> What is the problem?
>
> --
> Ran kornfeld
> rankorn@bezeqint.net
>
>
>
>
>
Tom Dacon at 2007-11-11 22:30:04 >
# 3 Re: Compilation problem with WinForms
Check out:

http://csharpindex.com/Default.asp?URL=/Faq/WhichDLLs.asp

Which shows you how to work out which DLLs to reference - Written for the
SimpleHelloWorld application.

I do hope Microsoft sort this out to help us newbies.

Cheers,

Matt.
C# Index to resources
http://csharpindex.com

"Ran Kornfeld" <rankorn@internet-zahav.net> wrote in message
news:39aa5b35@news.dev-archive.com...
> Hello
> I am tring to compile the simple Hello World winforms version but I get
the
> following error:
> error CS0234: The type or namespace name 'WinForms' does not exist in the
> class or namespace 'System'
>
> When I put a "/r:System.WinForms.dll" as a compiler parameter I get others
> strange errors as:
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.Control' has unknown
> base class or interface 'System.ComponentModel.MarshalByRefComponent'
>
> and
>
> System.WinForms.dll: error CS0011: Referenced class
> 'System.WinForms.RichControl' has unk
> nown base class or interface 'Microsoft.Win32.Interop.IOleControl'
>
> What is the problem?
>
> --
> Ran kornfeld
> rankorn@bezeqint.net
>
>
>
>
>
Matt Searle at 2007-11-11 22:31:09 >
# 4 Re: Compilation problem with WinForms
Thanks Guys.
It works.

--
Ran kornfeld
rankorn@bezeqint.net

"Matt Searle" <matt@8001dotted.com> wrote in message
news:39aac82a@news.dev-archive.com...
> Check out:
>
> http://csharpindex.com/Default.asp?URL=/Faq/WhichDLLs.asp
>
> Which shows you how to work out which DLLs to reference - Written for the
> SimpleHelloWorld application.
>
> I do hope Microsoft sort this out to help us newbies.
>
> Cheers,
>
> Matt.
> C# Index to resources
> http://csharpindex.com
>
>
> "Ran Kornfeld" <rankorn@internet-zahav.net> wrote in message
> news:39aa5b35@news.dev-archive.com...
> > Hello
> > I am tring to compile the simple Hello World winforms version but I get
> the
> > following error:
> > error CS0234: The type or namespace name 'WinForms' does not exist in
the
> > class or namespace 'System'
> >
> > When I put a "/r:System.WinForms.dll" as a compiler parameter I get
others
> > strange errors as:
> >
> > System.WinForms.dll: error CS0011: Referenced class
> > 'System.WinForms.Control' has unknown
> > base class or interface 'System.ComponentModel.MarshalByRefComponent'
> >
> > and
> >
> > System.WinForms.dll: error CS0011: Referenced class
> > 'System.WinForms.RichControl' has unk
> > nown base class or interface 'Microsoft.Win32.Interop.IOleControl'
> >
> > What is the problem?
> >
> > --
> > Ran kornfeld
> > rankorn@bezeqint.net
> >
> >
> >
> >
> >
>
>
Ran Kornfeld at 2007-11-11 22:32:07 >
# 5 Re: Compilation problem with WinForms
I haven't needed to add either system.dll or the interop dll to the command
line in order to build the WinForms sample. The following command line
worked just fine for me:

vbc clientVBWin.vb /r:System.WinForms.dll /r:..\Bin\CompCS.dll
/r:..\Bin\CompVB.dll /r:..\Bin\CompVC.dll /out:..\bin\ClientVBWin.exe
/t:winexe

Would anyone care to speculate why others seem to need the additional dll's,
and my installation (done exactly according to the directions with no custom
tinkering) doesn't?

Slightly puzzled,
Tom Dacon

"Matt Searle" <matt@8001dotted.com> wrote in message
news:39aac82a@news.dev-archive.com...
> Check out:
>
> http://csharpindex.com/Default.asp?URL=/Faq/WhichDLLs.asp
>
> Which shows you how to work out which DLLs to reference - Written for the
> SimpleHelloWorld application.
>
> I do hope Microsoft sort this out to help us newbies.
>
> Cheers,
>
> Matt.
> C# Index to resources
> http://csharpindex.com
>
>
> "Ran Kornfeld" <rankorn@internet-zahav.net> wrote in message
> news:39aa5b35@news.dev-archive.com...
> > Hello
> > I am tring to compile the simple Hello World winforms version but I get
> the
> > following error:
> > error CS0234: The type or namespace name 'WinForms' does not exist in
the
> > class or namespace 'System'
> >
> > When I put a "/r:System.WinForms.dll" as a compiler parameter I get
others
> > strange errors as:
> >
> > System.WinForms.dll: error CS0011: Referenced class
> > 'System.WinForms.Control' has unknown
> > base class or interface 'System.ComponentModel.MarshalByRefComponent'
> >
> > and
> >
> > System.WinForms.dll: error CS0011: Referenced class
> > 'System.WinForms.RichControl' has unk
> > nown base class or interface 'Microsoft.Win32.Interop.IOleControl'
> >
> > What is the problem?
> >
> > --
> > Ran kornfeld
> > rankorn@bezeqint.net
> >
> >
> >
> >
> >
>
>
Tom Dacon at 2007-11-11 22:33:12 >