Why is a “bindingRedirect” added to the app.config file after adding the Microsoft.Bcl.Async package?

The assemblies Microsoft.Threading.Tasks and Microsoft.Threading.Tasks.Extensions are still referencing v1.5.11.0 of System.Runtime and System.Threading.Tasks. Without the bindingRedirect, the Microsoft.* assemblies would try to load an old version of the System.* assemblies, which would fail.

How did Microsoft create assemblies that have circular references?

I can only tell how the Mono Project does this. The theorem is quite simple, though it gives a code mess. They first compile System.Configuration.dll, without the part needing the reference to System.Xml.dll. After this, they compile System.Xml.dll the normal way. Now comes the magic. They recompile System.configuration.dll, with the part needing the reference to … Read more

How to create multiple directories from a single full path in C#?

I would call Directory.CreateDirectory(@”C:\dir0\dir1\dir2\dir3\dir4\”). Contrary to popular belief, Directory.CreateDirectory will automatically create whichever parent directories do not exist. In MSDN’s words, Creates all directories and subdirectories as specified by path. If the entire path already exists, it will do nothing. (It won’t throw an exception)

What is C# analog of C++ std::pair?

Tuples are available since .NET4.0 and support generics: Tuple<string, int> t = new Tuple<string, int>(“Hello”, 4); In previous versions you can use System.Collections.Generic.KeyValuePair<K, V> or a solution like the following: public class Pair<T, U> { public Pair() { } public Pair(T first, U second) { this.First = first; this.Second = second; } public T First … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)