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 | 25 Comments »

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

  1. mccowinflooring.com Says:
    February 16th, 2022 at 08:23

    … [Trackback]

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

  2. sbo Says:
    March 2nd, 2022 at 19:49

    … [Trackback]

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

  3. sbo Says:
    March 13th, 2022 at 08:37

    … [Trackback]

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

  4. Continue Says:
    April 18th, 2022 at 21:26

    … [Trackback]

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

  5. DevOps services Says:
    May 16th, 2022 at 08:45

    … [Trackback]

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

  6. 홀덤 Says:
    May 28th, 2022 at 18:39

    … [Trackback]

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

  7. Alyssa SALT - the best song Says:
    June 22nd, 2022 at 09:55

    … [Trackback]

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

  8. nova88 Says:
    June 26th, 2022 at 23:47

    … [Trackback]

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

  9. loja de apps Says:
    July 16th, 2022 at 10:09

    … [Trackback]

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

  10. สล็อตวอเลท ไม่มีขั้นต่ำ Says:
    August 4th, 2022 at 18:42

    … [Trackback]

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

  11. sbobet Says:
    August 11th, 2022 at 10:18

    … [Trackback]

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

  12. check this site out Says:
    August 23rd, 2022 at 17:10

    … [Trackback]

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

  13. สล็อต pg เว็บตรง Says:
    August 27th, 2022 at 09:02

    … [Trackback]

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

  14. youtube music Says:
    August 31st, 2022 at 04:14

    … [Trackback]

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

  15. buy golden teacher mushrooms uk, Says:
    October 10th, 2022 at 15:26

    … [Trackback]

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

  16. best way to make passive income Says:
    October 13th, 2022 at 14:40

    … [Trackback]

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

  17. 贏家 Says:
    October 13th, 2022 at 16:24

    … [Trackback]

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

  18. dumps plus pin Says:
    October 14th, 2022 at 02:35

    … [Trackback]

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

  19. replica watches Says:
    October 24th, 2022 at 23:19

    … [Trackback]

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

  20. อ่านมังงะ Says:
    November 27th, 2022 at 00:08

    … [Trackback]

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

  21. fiziksel sunucu kiralama Says:
    December 14th, 2022 at 13:51

    … [Trackback]

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

  22. sbobet Says:
    December 16th, 2022 at 08:19

    … [Trackback]

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

  23. 토토휴게소 Says:
    December 21st, 2022 at 11:49

    … [Trackback]

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

  24. cornhole games Says:
    January 20th, 2023 at 00:06

    … [Trackback]

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

  25. Ammunition for sale online Says:
    February 1st, 2023 at 05:49

    … [Trackback]

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

Comments