troubleshooting Question

AppDomain DoCallBack causes error "Type is not marked as serializable"

Avatar of ericmhhui
ericmhhuiFlag for Canada asked on
.NET ProgrammingVisual C++.NET
4 Comments1 Solution3321 ViewsLast Modified:
Hi,

I have the following C++ code snippet that always give me the error.

The type A in Assembly ........... is not marked as serializable.

when I try to run it.  My class already has the [Serializable]
attribute.

What am I still missing or I am doing something wrong completely?

[Serializable]
__gc class A
{
public:
   A(void);
   ~A(void);
   String* S;
   bool B;
   void Calc ();
   Assembly* A;
   MethodInfo* M;

};

void myfunc ()
{
   AppDomain* Ad = AppDomain::CreateDomain ("myAd");
   A* objA = new A ();
   Ad->DoCallBack (new CrossAppDomainDelegate (objA, &A::Calc) );
}
ASKER CERTIFIED SOLUTION
Computer101

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros