Run C # .exe using crontab or daemon?

I was wondering if I can run dll (C #) using crontab? Dll compiles with mono.

thanks:)

- EDIT -

Well, it could be .exe. I looked at daemons on mac and linux, you think that I can run .exe as a daemon.

+4
source share
2 answers

Why not write a mono-based exe that uses the DLL method and the entry point method as parameters? Then exe will use reflection to load the DLL and execute the specified method. (You can choose a configuration convention by specifying something like the DllMain method in your DLL that exe will know to automatically call. Then you only need one parameter and the purpose of your code will become more obvious.)

Implementing such an applet will give you a utility similar to RunDll on Windows and allow you to run mono DLL files from cron.

+3
source

You can check the latest version of mono and C # Shell (although I would personally do an exe that calls the functions you want from the DLL).

http://www.mono-project.com/CsharpRepl

"At startup, the csharp shell will load any C # script files and precompiled libraries (ending in .dll) that are located in the ~ / .config / csharp directory (on Windows this is the environment value. GetFolderPath (Environment.SpecialFolder.ApplicationData)).

Assemblies are loaded first, and then scripts are executed. This allows your scripts to depend on the code defined in assemblies.

C # script files are simply files containing instructions and expressions; they cannot contain complete class definitions that must be saved and precompiled in DLL files. "

Then you can do things like:

csharp> using System; csharp> Console.WriteLine ("hello"); hello csharp> 
+3
source

Source: https://habr.com/ru/post/1342857/


All Articles