Hi, I am trying to get the following to work without much success:
This class is read from file and compiled in memory:
using System;
using Castle.ActiveRecord;
using iTradeStorage.ValueObjects;
namespace iTradeStorage.ValueObjects
{
[ActiveRecord]
public class iTradeType1 :
I actually had this same problem the other day, eventually found an obscure
reference to the actual error in an NH bug report.
You need to handle the AppDomain.CurrentDomain.AssemblyResolve event and
return your compiled assembly - do this before initialising ActiveRecord.
-Original
Hi and thanks Nicholas,
I am not sure I understand the solution you propose?
Plus the entire purpose of the exercise for me, is to dynamically
create assembly AFTER the active record initialization and to register
it after it's been compiled on the fly.
Note that I have tried to explicitly add
How is AR/NH meant to know about your type if it's not part of the
initialisation?
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.
-Original Message-
From:
Public Property CurrentAssembly As Reflection.Assembly
Public Property CurrentAssemblyName As String
Public Property CurrentAssemblyFullName As String
Public Sub New(ByVal asm As Reflection.Assembly)
''Code to set properties.
AddHandler AppDomain.CurrentDomain.AssemblyResolve,
The exception sounds like it needs an integer id, since [PrimaryKey] is a
shortcut for using Identity.
You can also try [PrimaryKey(PrimaryKeyType.Assigned)] instead.
-Markus
--
You received this message because you are subscribed to the Google Groups
Castle Project Users group.
To view this