[Mono-devel-list] About files, assemblies and compilation

Angel Garcia agarciazav at gmail.com
Wed Apr 13 22:28:25 EDT 2005


Hello,

I'm new in mono, and I have some dudes about compilation, I try to
obtain information, but I can't find anything.

The problem is simple, how can I make assemblies with a separates files?

first problem: supposse that I have 2 archives in a directory named space_1

--ArchA.cs--
using System;

namespace space1
{
class A
{
public void a()
  {
    Console.WriteLine("start A");
    Console.WriteLine("a");
    Console.WriteLine("end A");
  }
}
}

--ArchB.cs--
using System;
namespace space1
{
class B
{
public void b()
  {
    Console.WriteLine("start B");
    A a = new A();
    a.a();
    Console.WriteLine("b");
    Console.WriteLine("end B");
  }
}
}

Is possible to obtain an archive dll?, maybe using netmodules? What's
the command for make that?

Second problem: supposes the same configuration but in another
directory, say space_2, where I need the methods a and b, again I need
to obtain a dll.

--ArchC.cs--
namespace space2
{
using System;
using space1;

class C
{
public void c()
  {
    Console.WriteLine("start C");
    A a = new A();
    a.a();
    B b = new B();
    b.b();
    Console.WriteLine("c");
    Console.WriteLine("end C");
  }
}
}

--ArchD.cs--
namespace space2
{
using System;
using space1;
class D
{
public void d()
  {
    Console.WriteLine("start D");
    A a = new A();
    a.a();
    B b = new B();
    b.b();
    C c = new C();
    c.c();
    Console.WriteLine("d");
    Console.WriteLine("end D");
  }
}
}

What's the command line to obtain the dll?, say class2.dll 

Finally I want use the methods in a principal class

--Principal.cs--
using System;
using space1;
using space2;

class prueba
{
public static void Main()
  {
    Console.WriteLine("executing main");
    A s1 = new A();
    B s2 = new B();
    C s3 = new C();
    D s4 = new D();
    
    Console.WriteLine("calling a");
    s1.a();
    Console.WriteLine("\n\n calling b");
    s2.b();
    Console.WriteLine("\n\n calling c");
    s3.c();
    Console.WriteLine("\n\n calling d");
    s4.d();
  }
}

What's the command to obtain a principal.exe?

Thanks in advance, maybe the solution should be write in the FAQ or
something like that.
Angelus



More information about the Mono-devel-list mailing list