While Lucas's suggestion in AppDomains will work, alternatively you can create this effect using generics, since a class with different arguments of a general type is considered as another class, and therefore has its own static fields.
public class SomeClass<T> { public static string SomeField; }
Then:
SomeClass<int>.SomeField = "A"; SomeClass<string>.SomeField = "B"; Console.WriteLine(SomeClass<int>.SomeField);
For example, SomeClass<int> will be installed in the library, while SomeClass<string> will be your copy. Of course, this will only work if you can change the library or the library that already used the generic files.
Virtlink Jan 30 '15 at 12:06 2015-01-30 12:06
source share