Question Shared Libraries


Jul 6, 2016
Programming Experience
Hi! I'm trying to create a system from scratch, and C# is one of the languages I will use to implement it. The structure would be, the C# would be one of the middleware application. The aim is to call the function inside a DLL using C#. I heard it is possible however, one must re-declare the function (inside the DLL) as static extern. Now I have four questions regarding this situation:
  1. Since I'm calling it as static, it's not thread safe. Is it possible for C# to just release the function in memory after the return from the DLL has been made?
  2. The system I wanted to create will be compiled using Roslyn in .net core. The aim is to create a system that can run across different platforms. So for example I ran the system on Linux, will it read the DLL? How about *.a and *.so?
  3. Can Roslyn compile to *.a *.so? If I were to create a library using .net core, what will be the output file?
  4. What if the DLL is not coded in C / C++? Let's say Rust (or other PL that can compile DLL). How will I be able to call it to my C# application?
Top Bottom