[Mono-list] missing assembly reference?

Jaroslaw Kowalski jaroslaw.kowalski@atm.com.pl
Thu, 31 Jul 2003 10:57:27 +0200


Try passing -r parameter(s) to mcs:

mcs -r:System.Web.dll -r:System.Web.Services.dll  hello.cs

This tells the compiler to look for additional classes in the specified
assemblies.
Be aware that assemblies != namespaces. For example you have assembly named
"mscorlib" that contains namespaces like "System", "System.IO",
"System.Net".

Also, CSC.EXE on windows references some assemblies by default, they are:

Accessibility.dll
Microsoft.Vsa.dll
System.Configuration.Install.dll
System.Data.dll
System.Design.dll
System.DirectoryServices.dll
System.dll
System.Drawing.Design.dll
System.Drawing.dll
System.EnterpriseServices.dll
System.Management.dll
System.Messaging.dll
System.Runtime.Remoting.dll
System.Runtime.Serialization.Formatters.Soap.dll
System.Security.dll
System.ServiceProcess.dll
System.Web.dll
System.Web.Mobile.dll
System.Web.RegularExpressions.dll
System.Web.Services.dll
System.Windows.Forms.Dll
System.XML.dll

so when using CSC you don't need to specify references for them and they are
automatically available for "using". When using MCS you have to reference
assemblies by hand.

Jarek

----- Original Message ----- 
From: "Steffen Sledz" <sledz@zone42.org>
To: <mono-list@lists.ximian.com>
Sent: Wednesday, July 30, 2003 10:49 PM
Subject: [Mono-list] missing assembly reference?


> I'm a novice to the mono system and have some understanding problems.
>
> I've installed the mono RPM (mono-0.24-1) on my SuSE system and tried to
> compile a very simple hello.cs with some extra using lines:
>
>   using System;
>   // not really needed - just to demonstrate the problem
>   using System.Net;
>   using System.Diagnostics;
>   using System.Web;
>   using System.Web.Services;
>
>   class Hello
>   {
>   public static void Main(String[] args)
>     {
>        Console.WriteLine("mono:: is alive and well...");
>        for (int i = 0; i < args.Length; i++)
>          Console.WriteLine("Argument {0} = {1}", i, args[i]);
>     }
>   }
>
> Compiling with mcs gives this errors:
>
>   % mcs hello.cs
>   hello.cs(5) error CS0246: The namespace `System.Web' can not be found
(missing assembly reference?)
>   hello.cs(6) error CS0246: The namespace `System.Web.Services' can not be
found (missing assembly reference?)
>
> If i look into the RPM these assemblies seem to be available:
>
>   % rpm -q -l mono | grep System.Web
>   /usr/lib/System.Web.Services.dll
>   /usr/lib/System.Web.dll
>
> What's wrong here? Is there some machine or system configuration needed?
>
> Steffen
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>