-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: How to build - Recompiling NH 1.0.2 for log4net 1.2.10.0
PostPosted: Tue Jun 27, 2006 7:01 am 
Beginner
Beginner

Joined: Tue Jun 27, 2006 6:14 am
Posts: 24
Hi,

This is probably a total newbie question, sorry for that - but I can't seem to see the answer...

We are looking to use NHibernate with our project, but we are already using log4net 1.2.10.0 (the one with the strong name change... http://marc.theaimsgroup.com/?l=log4net-user&m=115089697317244&w=2

I tried to run NHibernate with this version, but got this error:

Code:
Could not load file or assembly 'log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905'


So I thought, no problem I'll recompile NHibernate against the new version... I built NH using the 1.0.2 install no problem - so I switched the log4net.dll and got then this error during the build:

Code:
            build:

               [attrib] Setting file attributes for 1 files to Normal.
                  [csc] Compiling 478 files to 'C:\installed\nhibernate-1.0.2.0\build\nhibernate-1.0.2.0\bin\NHibernate.dll'."
                  [csc] fatal error CS0009: Metadata file 'c:\installed\nhibernate-1.0.2.0\build\nhibernate-1.0.2.0\bin\log4net.dll' could not be open
ed -- 'Version 2.0 is not a compatible version.'

            BUILD FAILED

            C:\installed\nhibernate-1.0.2.0\src\NHibernate\NHibernate.build(70,4):
            External Program Failed: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe (return code was 1)

            Total time: 1.4 seconds.


Any thoughts?

Thanks in advance,
Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 7:40 am 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
You're building NHibernate against the 1.1 framework. So, quick sanity check, did you grab the log4net dll out of the 1.1 directory of the distribution? (log4net-1.2.10/bin/net/1.1/release/log4net.dll)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 2:07 pm 
Beginner
Beginner

Joined: Tue Jun 27, 2006 6:14 am
Posts: 24
Thanks - that must be it - its the other way around - I am using .Net 2.0 - but using the 1.1 hibernate....

Told you it was a total newbie question!

Thanks.
Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 4:03 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
How are you building this? MS Build or Nant?

I assumed you were trying to build with the 1.1 framework because of this line:

Code:
External Program Failed: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 4:23 pm 
Beginner
Beginner

Joined: Tue Jun 27, 2006 6:14 am
Posts: 24
I am away from my desk now and so can't answer fully - but I am using nant and missed the bit you pointed out about the error coming from the 1.1 csc.exe.

Perhaps there is a flag in the nhibernate nant script I need to switch for 2.0 or something in nant to make it the default.

Thanks,
Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 4:50 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
Do one of the following. Either add this at the top of the build file:

Code:
   <property name="nant.settings.currentframework" value="net-2.0" />



Or, invoke Nant like this:
Code:
>nant -t:net-2.0


Or, update your nant.exe.config from this:

Code:
    <nant>
        <frameworks>
            <platform name="win32" default="auto">


to

Code:
    <nant>
        <frameworks>
            <platform name="win32" default="net-2.0">


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 3:26 am 
Beginner
Beginner

Joined: Tue Jun 27, 2006 6:14 am
Posts: 24
Hi,

It seems the nh 1.0.2 is not setup for .net 2.0 - I am going to try the 1.2 route instead - our DB is small and so the risk should be low.

Thanks for all the ideas
Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.