Error: Unable to Load AppDomain Proxy

Nov 21, 2011 at 4:08 AM

I'm getting the following error when I want to generate business components (BC). Previously I already success in creating business.entities and data access component (DAC).
FYI, i already updated my Visual Studio 2010 to SP1. And also I already try the suggestion steps in the error message and it's not working.

Please ensure that you have Visual Studio 2010 Service Pack 1 (or higher) installed and if the issue still exist, you can try to load the Data Access Component Generator first and connect to a database before launching any coed generators that uses .NET Reflection.

Error:Object reference not set to an instance of an object.
StackTrace: at CodeGenerator.Framework.ProxyAppDomain.LoadAssembly(String fileName) at CodeGenerator.BC.MainControl.LoadAssembly()


Nov 21, 2011 at 6:15 AM
Edited Nov 21, 2011 at 6:36 AM

Hi Kevin,

This is one of those critical errors which I have problem tracking/solving until today. It only happens on certain machine configurations and I am not able to resolve it correctly.

Here are some suggestions:

  • Are you running your VS 2010 as Administrator? 
  • Can you load the DAC Gen, connect to your database and then exit the DAC gen. Then try to load other generators i.e. BC gen to see if the issue still persists.
  • Are you running on a x64 Windows OS?
  • Do you have SQL Server 2008 R2 Management Objects installed?
  • Compile your DAC project.

Do keep me updated.

FYI, This is caused by the .NET Reflection code that inspects your assemblies. Somehow, it cannot load the CodeGenerator.Framework.dll.


Nov 21, 2011 at 7:23 AM

Hi Serena,

Thanks for the suggestions. I will try based on those suggestions and get back to you soon.