Why do they call assemblies for module

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hi!

Why do they call an assembly for module
Here I have an example of that. So when I call GetModules and write out this
I write out the exe file or dll file where this piece of code is located in.

Assembly ass = Assembly.GetExecutingAssembly();
foreach (Module mod in ass.GetModules())
{
Console.WriteLine("Module Name: {0} ", mod.Name);
}

//Tony
 
Why do they call an assembly for module
Here I have an example of that. So when I call GetModules and write out this
I write out the exe file or dll file where this piece of code is located in.

Assembly ass = Assembly.GetExecutingAssembly();
foreach (Module mod in ass.GetModules())
{
Console.WriteLine("Module Name: {0} ", mod.Name);
}

All normal assemblies just consist of one module, but you can
build an assembly consisting of multiple modules.

Arne
 
All normal assemblies just consist of one module, but you can
build an assembly consisting of multiple modules.

Demo:

C:\>type M:cs
The system cannot find the path specified.

C:\>type O.cs
using System;

public class O
{
public void FooBar()
{
Console.WriteLine("Hello world");
}
}

C:\>csc M.cs O.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.


C:\>M
Hello world
M.exe

C:\>csc /t:module O.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.


C:\>csc /t:exe /addmodule:O.netmodule M.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.


C:\>M
Hello world
M.exe
O.netmodule

Arne
 
Back
Top