CrossAppDomainSerializer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Matt Davey (matt.davey_at_finetix.com)
Date: 03/12/04


Date: Fri, 12 Mar 2004 15:28:18 -0000

For certain reasons which I won't go into we are running an application in a
AppDomain we create, and not in the default AppDomain. It appears from
SciTech's .NET Memory Profiler that when we use reflection to retrieve a
property value (string or double type) off an object, we incurring an
AppDomain marshal:

CrossAppDomainSerializer.SerializeObject(object)
AppDomain.Serialize(object)
AppDomain.MarshalObject(object)
RuntimeMethodIngo.InternalInvoke(object, BindingFlags, Binder, object[],
CultureInfo, bool)
RuntimeMethodIngo.Invoke(object, BindingFlags, Binder, object[],
CultureInfo)
MethodBase.Invoke(object, object[])
RuntimePropertyInfo.GetValue(object, object[])

If we run the same code in the default AppDomain, no AppDomain marshal
occurs (as expected). There is no code in any other AppDomain apart from
the AppDomain we created. The only unusual thing about this application is
that the strings are allocated (Marshal::PtrToStringAnsi) by Visual C++
(assembly built with /clr:initialAppDomain).

Anyone got an ideas what is going on?



Relevant Pages

  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result ... > "Joe Fallon" wrote in message ... Rick Strahl's article showed how to create a separate appdomain. ... >>> Based on how other assemblies work with an AppDomain that is correct. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result ... > "Joe Fallon" wrote in message ... Rick Strahl's article showed how to create a separate appdomain. ... >>> Based on how other assemblies work with an AppDomain that is correct. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result ... Rick Strahl's article showed how to create a separate appdomain. ... > count the number of times I dynamically executed a snippet. ... >> Based on how other assemblies work with an AppDomain that is correct. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result ... Rick Strahl's article showed how to create a separate appdomain. ... > count the number of times I dynamically executed a snippet. ... >> Based on how other assemblies work with an AppDomain that is correct. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: CreateInstance and New Sub
    ... Assembly.CreateInstance Method (String, Boolean, BindingFlags, Binder, ...
    (microsoft.public.dotnet.framework)