How To Create Assembly with more than One Module

In this post, I will show how to create an assembly that 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

Post a Comment

Please do not post any spam link in the comment box😊

Previous Post Next Post

Blog ads

CodeGuru