How to Setdata to new Appdomain
问题 How to SetData to new created AppDomain. When i DoCallBack to my testFunc i receive " System.NullReferenceException " exception. What i do wrong? var client = "test"; var engine = 123; AppDomain appDomain = AppDomain.CreateDomain("newDomain"); appDomain.SetData("client", client); appDomain.SetData("engine", engine); appDomain.DoCallBack(testFunc); private void testFunc() { var client = (string)AppDomain.CurrentDomain.GetData("client"); var engine = (int)AppDomain.CurrentDomain.GetData("engine