Static Variable Instances and AppDomains, what is happening?

前端 未结 2 1981
面向向阳花
面向向阳花 2020-12-05 10:49

I have

public static class A
{
   public static string ConnString;
}

[Serializable]
public class Test{
   // Accesing A\'s field;
   public string ConnStrin         


        
2条回答
  •  鱼传尺愫
    2020-12-05 11:10

    You marked your Test class as Serializable. This is wrong. You should have derived from MarshalByRef. Otherwise TObj will just be a local copy in the current AppDomain.

提交回复
热议问题