Kevin Williams wrote:
Thanks for answering, Ian.
This is my first time trying to use NAnt in production. We've decided to use NHibernate, and I want <hbm2net> and <schemaexport> tasks. Of course, we need this yesterday.I'm not clear. Do those tasks exist as part of NHibernate or have you just created them ?
Sorry. These are provided by Hibernate(Java) for Ant, and we need the equivalent tasks for NAnt/NHibernate. I am writing these tasks myself since they don't exist in NHibernate yet. The strange part is that the <hbm2net> task works fine. It uses a stand-alone .exe with it's own config file. I can set the <schemaexport> task to call an external SchemaExport.exe with it's own config file, but it doesn't work. It's possible to call the SchemaExport class from inside the NHibernate.dll, and I've tried that too with no success.
When you say 'doesn't work' - what error message are you getting ?
I haven't looked at that code but I'm fairly sure nunit will load that config file manually.
I'm having trouble with the <schemaexport> task. NHibernate won't work without some parameters and a log4net section in a config file. I can call the SchemaExport class directly from the NHibernate.dll, but it can't find it's config. If I create a "NHibernate.Tasks.dll" file and a "NHibernate.Tasks.dll.config" file, it appears that the config file is ignored by NHibernate, as is the existing log4net configuration in NAnt.exe.config. How can I specify the config file for an assembly being loaded?you don't is the general answer. There is one .net config file per process as a rule unless you have that dll assembly load a config file manually. This sounds like it would be an issue for any app calling NHibernate and not a NAnt specific issue. ( correct me if I'm wrong ). Have you posed the same question to the NHibernate developers ?
By comparison, in NUnit one can write a *.nunit file and specify the config file to use for a DLL. I don't know how NUnit makes use of this, but it works.
I would expect that a general DOMConfigurator.Configure() call in a task would use the existing configuration for NAnt.exe, but that doesn't seem to be the case here. I'm sure I have overlooked something, but I don't know if it's the NAnt build file, the tasks I wrote, the config file, or something else.
What happens when you do this ? Do you get an error here as well ?
that might be an option. Right now most task assemblies loaded by nant are found just be scanning a certain directory and don't need access to individual config files. If you feel like coding up a patch for <loadtasks> to do this that would be good too.
I haven't posted this to the NHibernate forums (yet) because I thought if the <loadtasks> task had a "configfile" attribute like NUnit, that would solve my problem. I will pose this question there as well.
For now you might be better off manually loading a NHibernate.Tasks.dll.config in the task code. There is an article on per-assembly config file here [1] that may be of some use.
Ian
[1] http://www.theserverside.net/developmentor/thread.tss?thread_id=25076
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users