Load external C#/C++ dll from a specific folder in C#

In my company we wanted to bring together external dlls into one folder named “Libs” next to the executable. Indeed, when you have many dlls (and not all written in C#), it’s more readable to put them all in one folder that contains the dependencies of the project. 1. Add required files then set parameters... » read more

Using Apache Thrift to provide cross-languages communication

The Apache Thrift is a software framework used to facilitate binary communication. Based on RPC (remote procedure call) it was developed by Facebook and provide the complete stack for creation clients/server solutions. Cross-language is one of the most useful feature of Thrift by providing a lot of supported programming languages (C#,C++, Java, Php, Node.js, Cocoa, …). The common struct and service should be written in .thrift files using the interface definition language of the framework.

Comment utiliser une librairie statique (.lib) en C++ dans un projet C# ?

Au cours du développement d’un projet j’ai été confronté à la problématique suivante: Comment utiliser une librairie dynamique (.lib) en C++ dans un projet C# ? Fichiers: Executables (38ko) Source (428ko) 1. Présentation du contexte La solution est composée des 3 projets suivants : MonApplication.exe [C++, MFC] Un client lourd qui doit fonctionner de Windows... » read more

Récupérer le nom de la classe et de la méthode courante

Il peut être très utile de récupérer le nom de la classe et de la méthode courante. Pour se faire, il suffit d’ajouter la méthode suivante dans une classe utilitaire : Utils.cs public static string GetCurrentMethodName() { StackTrace stackTrace = new StackTrace(); StackFrame stackFrame = stackTrace.GetFrame(1); return stackFrame.GetMethod().DeclaringType + " :: " + stackFrame.GetMethod().Name; }public... » read more

ActiveDirectory : Vérifier si un utilisateur appartient à un groupe (C#)

1. On définit les paramètres de connexion dans notre app.config   <!-- Active Directory --> <!-- Active Directory --> 2. Nous créons ensuite la classe static ActiveDirectory en exposant la méthode IsUserMemberOfGroup public static class ActiveDirectory { /******************************************************************** * Shared properties * ********************************************************************/ private static DirectoryEntry ldap;   /******************************************************************** * Exposed methods * ********************************************************************/ public... » read more