Compdigitec Labs

« | Home | »

Linking a shared assembly in the Mono C# compiler

By admin | December 23, 2008

If you wrote a class in C++ and wanted to use it in many applications, you could simple #include it in each application you wanted to use it in. But if you wrote a class in C# and wanted to use it in many applications, you cannot just #include it, because there is no #include in the C# language! The solution to this is to reference the library. This article will show you in easy steps:

  1. After you have written the class, compile it into a library with “gmcs ClassXyz.cs -target:library” (replace ClassXyz.cs with your class’s filename)
  2. The command above should generate a shared library/assembly called ClassXyz.dll.
  3. Now you can compile the application with “gmcs ProgramXyz.cs -reference:ClassXyz.dll”.

If you found this article useful or helpful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux | 13 Comments »

13 Responses to “Linking a shared assembly in the Mono C# compiler”

  1. sugar rush slot Says:
    March 29th, 2025 at 14:21

    … [Trackback]

    […] Info on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  2. motherboard for gaming hyderabad Says:
    March 30th, 2025 at 10:07

    … [Trackback]

    […] Information on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  3. เทคโนโลยีพลังงานทดแทน Says:
    April 22nd, 2025 at 20:13

    … [Trackback]

    […] There you can find 81093 additional Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  4. fast-paced crash game Says:
    April 23rd, 2025 at 12:40

    … [Trackback]

    […] There you can find 7827 additional Info to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  5. continue reading Says:
    May 1st, 2025 at 00:13

    … [Trackback]

    […] Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  6. Family Lotto เว็บหวยออนไลน์ จ่ายบาทละ 1000 มีหวยทุกรูปแบบ Says:
    May 3rd, 2025 at 07:25

    … [Trackback]

    […] Find More here on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  7. developer website Pragmatic Play Says:
    May 9th, 2025 at 09:05

    … [Trackback]

    […] Information on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  8. โรงแรมศรีราชา Says:
    May 11th, 2025 at 19:52

    … [Trackback]

    […] There you will find 10468 more Info on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  9. สั่งสินค้าจากจีน Says:
    May 16th, 2025 at 21:56

    … [Trackback]

    […] There you can find 74692 additional Info to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  10. pinco Says:
    May 24th, 2025 at 11:40

    … [Trackback]

    […] Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  11. vox casino Says:
    May 24th, 2025 at 14:46

    … [Trackback]

    […] Find More on that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  12. ระบบจัดการออเดอร์ Says:
    May 29th, 2025 at 20:07

    … [Trackback]

    […] Information to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

  13. โรงงานรับผลิตอาหารเสริม Says:
    June 1st, 2025 at 07:57

    … [Trackback]

    […] Find More Info here to that Topic: compdigitec.com/labs/2008/12/23/linking-a-shared-assembly-in-the-mono-c-compiler/ […]

Comments