howto: update your solution to NHibernate 2.1 and Castle 2.0

6 views
Skip to first unread message

todd brooks

unread,
Aug 4, 2009, 6:40:39 AM8/4/09
to S#arp Architecture
This is just an fyi, hopefully it will help someone else. ymmv If I
have forgotten something, please let me know.

Below is a quick checklist to get a S#-based solution to work with
NHibernate 2.1 and Castle 2.0. It isn't enough to just update your own
project and its references to NHib 2.1 and Castle 2.0. You will need
to update and rebuild S# along with other dependencies.

Besides getting the latest binaries of NHibernate 2.1, you will need
to get the Castle 2.0 source, replacing the NHibernate assemblies with
the 2.1 ones and then rebuild Castle. If you get the latest binaries
from FluentNHib (1.0.538), it has already been built against NHib 2.1
and Castle 2.0. Copy all of these rebuilt assemblies into the S# bin
directory.

Then you will then need to get NHibernate.Validator 1.2.0 b1 from here
http://sourceforge.net/projects/nhcontrib/files/ (scroll down to
NHibernate.Validator and get the binaries). They are already built
with NHib 2.1 and Castle 2.0, so just grab the binary. Copy to the S#
bin directory.

Next you will need to get CommonServiceLocator.WindsorAdapter from
here http://commonservicelocator.codeplex.com/Wiki/View.aspx?title=Castle%20Windsor%20Adapter
You will need to replace the libs in the SharedLibs dir with those of
NHib 2.1 and Castle 2.0. Rebuild it and copy to the S# bin directory.

Get the MvcContrib source from here http://www.codeplex.com/MVCContrib
and copy your rebuilt NHibernat 2.1 and Castle 2.0 assemblies into the
bin\castle directory and rebuild MvcContrib. copy the MvcContrib*
assemblies into the S# bin directory.

At this point, you should be able to rebuild S#. (You might have to
correct some references...I think a reference to NHibernate.Validator
complained), so you might have to open the solution in VS before you
rebuild. Replace the S# assemblies in your shared lib folder for your
project with these.

Don't forget with NHib 2.1 you must specify in your NHibernate
configuration file which dynamic proxy you will be using (LinFu,
Castle or Spring) and deploy the specified assembly too.

I believe that is all that is necessary to get it working (hopefully I
didn't forget anything).

queen3

unread,
Aug 4, 2009, 4:51:59 PM8/4/09
to S#arp Architecture
Thanks a lot! I spent half an hour trying to add NHibernate 2.1
support (because of the new Linq released) but gave up... Had no time
to figure out all the dependencies and who's still asking for the old
NH assembly.

You saved me a lot of time. I'm only going to use the solution
tomorrow, but I'm sure this will work.

Kyle Baley

unread,
Aug 5, 2009, 10:27:01 AM8/5/09
to sharp-arc...@googlegroups.com
I just went through this but didn't have to re-build Castle. I just took it from the lib folder in the latest NHibernate code (or NH.Validator or Fluent NH, don't recall quite which one it was).

Hopefully HORN will fix this problem shortly.

todd brooks

unread,
Aug 5, 2009, 10:38:57 AM8/5/09
to S#arp Architecture
I actually looked at Horn when trying to get everything sorted out,
but wasn't on my priority list at the time. I'm glad you didn't have
to rebuild Castle, that removes one step.

todd

On Aug 5, 9:27 am, Kyle Baley <k...@baley.org> wrote:
> I just went through this but didn't have to re-build Castle. I just took it
> from the lib folder in the latest NHibernate code (or NH.Validator or Fluent
> NH, don't recall quite which one it was).
>
> Hopefully HORN will fix this problem shortly.
>

Roger

unread,
Aug 14, 2009, 9:39:17 AM8/14/09
to S#arp Architecture
Thanks for sharing the updating steps. I have to redirect
Castle.Windsor, NHibernate, FluentNHibernate and NHibernate.Validator
dll versions in app.config of xxx.Test project after the update. The
reason is that my project keeps looking for older versions of dlls.

An example:
<dependentAssembly>
<assemblyIdentity name="NHibernate"
publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.0.3001"
newVersion="2.1.0.4000"/>
</dependentAssembly>

Is the bindingRedirect a required step also? Thanks.
> > > tomorrow, but I'm sure this will work.- Hide quoted text -
>
> - Show quoted text -

todd brooks

unread,
Aug 14, 2009, 5:42:13 PM8/14/09
to S#arp Architecture
Yes, you are correct. That was something I could never figure out is
to why I still needed the binding redirect after I rebuilt everything
using NHibernate 2.1. My cheat, was to use a catch-all binding
redirect in my web.config similar to yours:

<dependentAssembly>
<assemblyIdentity name="NHibernate"
publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535"
newVersion="2.1.0.4000"/>
</dependentAssembly>

Jamir Shaikh

unread,
Aug 15, 2009, 11:57:24 AM8/15/09
to sharp-arc...@googlegroups.com
Is it possible that one of the first mover to nHibernate 2.1 (from S#arp RTM) can have all the newer dlls in a zip file and publish it?


todd brooks

unread,
Aug 16, 2009, 6:18:08 PM8/16/09
to S#arp Architecture
I can't guarantee this will work on your system, as my lib directory
is combined with my test libs, but here is a zip of my shared lib
directory with NHibernate 2.1 and Castle 2.0. These are all Release
Build dlls, too.

If there is a problem posting these dll's let me know, but again, use
at your own risk.

http://drop.io/1amlk5o

Regards,

todd

Jamir Shaikh

unread,
Aug 16, 2009, 11:50:26 PM8/16/09
to sharp-arc...@googlegroups.com
Thanks Todd.

kebin

unread,
Aug 24, 2009, 3:30:56 PM8/24/09
to S#arp Architecture
Refer to the post by Tom Cabanski

http://groups.google.com/group/sharp-architecture/browse_thread/thread/f5a4f9a34bb3f8dd

Thanks

On Aug 16, 8:50 pm, Jamir Shaikh <jamir.sha...@gmail.com> wrote:
> Thanks Todd.

JMan

unread,
Sep 4, 2009, 2:05:47 PM9/4/09
to S#arp Architecture
Is it me or does this seem like a nigthmare?



On Aug 24, 2:30 pm, kebin <gagglef...@gmail.com> wrote:
> Refer to the post by Tom Cabanski
>
> http://groups.google.com/group/sharp-architecture/browse_thread/threa...
>
> Thanks
>
> On Aug 16, 8:50 pm, Jamir Shaikh <jamir.sha...@gmail.com> wrote:
>
>
>
> > Thanks Todd.- Hide quoted text -

todd brooks

unread,
Sep 4, 2009, 3:04:29 PM9/4/09
to S#arp Architecture
It is. Hopefully the Horn project will simplify the building of all
the requisite pieces.

todd

JMan

unread,
Sep 4, 2009, 3:56:59 PM9/4/09
to S#arp Architecture
I think basically at this point I can't really use S#arp Architecture
in the current state, it's just falling behind too quickly and can't
keep up with the core dependencies that make it work.
> > > - Show quoted text -- Hide quoted text -

Bobby Johnson

unread,
Sep 4, 2009, 4:58:09 PM9/4/09
to sharp-arc...@googlegroups.com
I'm not quite sure what is stopping you from using v1.0 of s#arp. It works fine right out of the box and when v.Next hits there will be an upgrade path. If you are not comfortable upgrading dependencies manually, wait for the next version. What is the problem?
--
"The explanation requiring the fewest assumptions is most likely to be correct."

- Occam’s Razor
http://en.wikipedia.org/wiki/Occam's_Razor

Alec Whittington

unread,
Sep 4, 2009, 5:12:11 PM9/4/09
to sharp-arc...@googlegroups.com
Bye!

Cheers,
Alec Whittington




On Fri, Sep 4, 2009 at 12:56 PM, JMan <jwis...@gmail.com> wrote:

Tom Cabanski

unread,
Sep 4, 2009, 11:31:05 PM9/4/09
to sharp-arc...@googlegroups.com
I did it, it took me just under an hour to put together SharpArch and another 90 minutes to fix the stuff that broke in my app.  I would characterize it as as tedious but certainly not a nightmare.
 
I have the necessary patches for SharpArch up on my blog.  I haven't submitted them because the word here is that SharpArch is moving over to GitHub and so I'll just wait to fork it.  Once we have that, it should be pretty easy to make hornget work so anyone that wants the latest version of all or selected dependencies can do it more easily.
 
The beauty of open source is the solution is always in our hands.  The problem with open source is we have to do the work.
 


 
--
Tom Cabanski
Vice President of Technology
Onpoint On Demand (Houston Office)
4801 Woodway Drive
Suite 300 East
Houston, TX 77056
Direct: 713-962-2638
http://www.onpointod.com

Kyle Baley

unread,
Sep 5, 2009, 9:34:48 PM9/5/09
to sharp-arc...@googlegroups.com
I suppose we could switch to using third-party libraries that are no longer active...

JMan

unread,
Sep 6, 2009, 11:27:42 AM9/6/09
to S#arp Architecture
How about reducing the dependencies and let S#arp architecture create
its own instead of depending on so many others.

Kyle Baley

unread,
Sep 6, 2009, 11:45:06 AM9/6/09
to sharp-arc...@googlegroups.com

Alec Whittington

unread,
Sep 6, 2009, 7:03:53 PM9/6/09
to sharp-arc...@googlegroups.com
  • So you would have it build it's own ORM? 
  • You would have it build it's own fluent language for this ORM?
  • You would have it build it's own dependency injection / Inversion of Control container and ALL that goes along with it?
Seriously, if you don't get what is going on and why, just ask us, we'll be happy to explain it all to you. If you're looking for something that is plug and play, yet always on the bleeding edge, then you might want to look further. Most of us on here have been working with Billy on this since close to the beginning. We have gone through the bleeding edge, massive breaking changes, and are HAPPY that things have settled down. Now if I need to make use of a bug fix / new feature of one or more the dependencies, this is all open source, I can go get it, build it, and make it work. 

Here's are some great ideas:
  1. Go to the group page at google and learn to use the search button. Your very firsts posts are things that were clearly discussed and you would've easily found answers to.
  2. Tone your attitude down some. You are coming off as a very selfish and demanding person. Might find people more receptive to listening to you.
  3. Instead of taking from an OSS project, why not contribute to it? Tom Cabanski is great example of this. His first posts were a mere few weeks ago and he has already made some significant contributions to the group.
This group has been one of the most helpful groups I have ever been apart of, but lately the give give give me attitude of new members has really been getting to me. Sorry if I rant and vent on this, but damn people, learn to research. It is the bane of our existence as programmers, if you can't research you might want to look for a new career field.

Sorry Billy, Kyle, James G, Tom C, et al - but finally had enough.

Alec Whittington

JMan

unread,
Sep 6, 2009, 11:02:23 PM9/6/09
to S#arp Architecture
what are you 12?

On Sep 6, 6:03 pm, Alec Whittington <alec.whitting...@gmail.com>
wrote:
>    - So you would have it build it's own ORM?
>    - You would have it build it's own fluent language for this ORM?
>    - You would have it build it's own dependency injection / Inversion of
>    Control container and ALL that goes along with it?
>
> Seriously, if you don't get what is going on and why, just ask us, we'll be
> happy to explain it all to you. If you're looking for something that is plug
> and play, yet always on the bleeding edge, then you might want to look
> further. Most of us on here have been working with Billy on this since close
> to the beginning. We have gone through the bleeding edge, massive breaking
> changes, and are HAPPY that things have settled down. Now if I need to make
> use of a bug fix / new feature of one or more the dependencies, this is all
> open source, I can go get it, build it, and make it work.
>
> Here's are some great ideas:
>
>    1. Go to the group page at google and learn to use the search button.
>    Your very firsts posts are things that were clearly discussed and you
>    would've easily found answers to.
>    2. Tone your attitude down some. You are coming off as a very selfish and
>    demanding person. Might find people more receptive to listening to you.
>    3. Instead of taking from an OSS project, why not contribute to it? Tom

Martin Hornagold

unread,
Sep 7, 2009, 4:27:11 AM9/7/09
to sharp-arc...@googlegroups.com
Alec is not alone in his views JMan.
He is a valued member of this community who has contributed a great deal.
I suspect you have got the backs up of many in this community.
Your tone has been both demanding and confrontational.

Kyle Baley

unread,
Sep 7, 2009, 5:36:58 AM9/7/09
to sharp-arc...@googlegroups.com
I put this up in jest but the question at the end is still valid: Which dependencies did you have in mind?
Reply all
Reply to author
Forward
0 new messages