If I consider the basic implementation of the singleton, for example:
private static Foo instance;
private readonly static Object SyncRoot=new Object();
public static Foo Instance {
get {
if(instance!=null)
return instance;
lock(SyncRoot) {
if(instance!=null) {
return instance;
}
instance=new Foo();
return instance;
}
}
}
Is there any situation I get two different singletons in the same application? (dynamic dll load with reflection, execution and syncronization context's, appdomain class, or any other type of "magic"?)