You need to handle the AppDomain.CurrentDomain.AssemblyResolve event and
return your compiled assembly - do this before initialising ActiveRecord.
((ActiveRecordBase)theObject).Save();
Can somebody kindly help?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to
castle-project-u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.
The problem is with NH and how it loads assemblies during configuration,
which is why you should handle the AssemblyResolve event and return your
runtime compiled assembly.
Public Sub New(ByVal asm As Reflection.Assembly)
''Code to set properties.
AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf
ResolveAssembly
End Sub
Private Function ResolveAssembly(ByVal sender As Object, ByVal e As
ResolveEventArgs) As Reflection.Assembly
If e.Name = CurrentAssemblyName Or e.Name = CurrentAssemblyFullName
Then
Return CurrentAssembly
End If
End Function
Reg,
Attach a failing project that does the dynamic compile and I'll have a look. I did some other fixes with regards registering the dynamically compiled types, so there may be something I'm doing that I can't recall fixed your particular problem.
Regards
Nick