Carlos Ble

Carlos Ble

I am a professional software developer, I solve problems.

I also teach and mentor developers to build better software.

Developing software since 2001.

Can I help you?

  • Do you need high quality tailor-made software?
  • Need training on TDD, clean code or refactoring?
  • Do you need a technical consultant?
  • May I pair with you to write better code?


Upcoming training courses:

  1. TDD - [en Español] - 6 y 7 Octubre
    Gran Canaria
  2. TDD - [in English] - October 20, 21 & 22
    London, UK
  3. TDD - [en Español] - 29, 30 y 31 de Octubre.
    Madrid, Spain


  1. I'll be at the Agile Testing Days 2014
  2. I'll be at the London Test Gathering Workshops.

Dynamic assemblies and serialization

The AbstractBindableWrapper is getting more and more difficult. I am facing a lot of problems regarding Windows Forms and WPF databinding and of course regarding Reflection.Emit. AOP is very cool but is not easy to implement. I've written a dynamic proxy generator which creates an assembly and classes inside it. The idea is to have a double proxy for every business object that needs to be bound to the UI.

  1. The first proxy extends the business object and implements the INotifyPropertyChanged interface. This proxy is created with the DynamicPropertyChangedProxy class. It has been a challenge to write that class.
  2. The second one uses the interception pattern and is generated by Castle.DynamicProxy2 and its purpose is to raise the PropertyChanged event everytime the bound properties are changed. This second extends from the first

Now the last problem I've found is the deserialization of a class that is contained within a dynamic assembly, that is, the deserialization of the proxies. I've found also the solution and implemented it. It is working fine.

"In general, the formatter, during deserialization, loads the assembly by calling Load or LoadWithPartialName and because of which CLR will not find a dynamic assembly. One solution is to provide an event handler for AppDomain.CurrentDomain.AssemblyResolve event which gets called whenever the formatter fails to load an assembly. The identity of the assembly that failed during load is passed to this method. Your event handler can use the name to construct a path where the assembly file is available and use Assembly.LoadFrom(assemblyPath) to return Assembly."

   1:  public static Assembly OnAssemblyResolve(Object sender, ResolveEventArgs args)
   2:  {
   3:      if (args.Name.StartsWith(DYNAMIC_MOD_NAME))
   4:      {
   5:          return Assembly.GetAssembly(MyAssemblyBuilder.GetTypes()[0]);
   6:      }
   7:      return null;
   8:  }

The idea is to release Boxerp 0.2 within a month including all this stuff and these posts are part of the documentation.

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
  • ugg boots in uk

    strongzz whoah this blog is great i love reading your posts. Keep up the good work! You know, many people are searching around for this info, you can help them greatly.

  • gutter cleaners

    This is actually great content. Thanks for this. I put it on my website where you can also find latest game and technology news and reviews . I linked returning to your site and bookmarked it in order to see your new posts.