How To Create Assembly with more than One Module

In this post i will show how to create assembly which contains more than one module. Create below files in the same folder Bar.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Module
{
public class Bar
{
    public override string ToString()
    {
        return "Hi from Bar";
    }
}
}


Foo.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Module
{
class Foo
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello from Foo");
        Bar obj = new Bar();
        Console.WriteLine(obj.ToString());
        Console.ReadLine();
    }
}
}

Now go to visual studio command prompt and change to the source file and execute the following command

No comments:

Post a Comment