assembly file

Hi everyone,
I have again some doubts about assemblies.
Suppose that w ecreate a class and then use some classes from different packages in this class.
So, when I examine the references section about my project, I see that the all packages that I use is added into it.
My question is that when I execute my program in the same class(in other words , my main method is located in the class that I use), do the assembly file, which is createn at the compile time, consist of the reference section and my own class

Menawhile, I know that assembly file also contain metada and manifest but I refer to the IL part.

Thanks



Answer this question

assembly file

  • Stéphane Beauchemin

    The online MSDN Library defines an Assembly as "a reusable, versionable, and self-describing building block of a common language runtime application."

    In short: one project in Visual Studio will compile to one assembly (basicaly, except for the new ASP.Net website or when you have projects under projects and so on...). This can be one of the project types like Windows Application, Console Application, Class Library and so on.

    Referenced code is NOT compiled into your own assembly. When referencing assemblies from the .Net framework for instance, the resulting assembly will use the .Net framework assemblies contained in the Global Assembly Cache (GAC) on the computer it is called on. That's the reason a computer needs the .Net framework installed when you want to run a .Net application.
    When you reference third party assemblies which are not in the GAC, compiling your assembly will copy that assembly and put it next to your assembly. So the code is not incorporated in your own assembly, but copied next to it.

    HTH

  • gg1

    Hi,
    Another question is that , can we also be regarded System, System.Data,... namaspaces as a DLL files of .NET platform


  • Avy32

    Thanks for your clarifications.
    Now I think I kept the idea. References are different concept from Assemblies. They are like a storage that we put all the DLL's or assemblies which we are going to use in our project.
    However, assembly consist of the main namespace only which contains the whole project, is not it

    Thanks


  • zackasan

    Are there any real difference amond these
    1 )main namespace(For example: namespace ClassLibrary1)of the project ,

    2 ) DLL file of the project

    3 ) Assembly of the project


  • Shahab03

    Hi,
    I finally found the answer of my last question.
    We can only add the .dll files into the references which we are going to use the classes of.
    System namespace has a description called System.dll and its type is Assembly.

    Thanks


  • raingod_zippo

    If we want to use a class which is not located in our project's main namespace, we sould add its DLL(the main namespace of its project) to the reference and use "using" keywords in the code in order to use the classes of this DLL , is not it


  • jiao

    Hi everyone,
    Would anyone please help me about this

    Thanks


  • QWERTYtech

    Technically you can add as many namespaces to your project as you would like. Every class, struct, enum etc. can have its own namespace which has nothing to do with the other namespaces in your project.

    A namespace is basically nothing else than the name of the box your classes are in. If you need stuff that's got something to do with reflection, look in the box System.Reflection. For Forms-stuff, get te box System.Windows.Forms.

  • donno20

    Another question about this is that it is said that assembly files is a DLL file or exe files. however, assembly contains exe files(according to me, exe files is the file which contain main method).
    So how can an assembly file be an exe file at the same time




  • Tara H

    Hi, in other words,
    Does the assembly files consit of the main namespace which inculde the project that currently using and the the packages in the reference part

    Thanks


  • assembly file