Upgrading from 2.0RC to 2.0.2

364 views
Skip to first unread message

Carl Bussema

unread,
Feb 7, 2012, 4:39:32 PM2/7/12
to sharp-arc...@googlegroups.com
I'm having a great time trying to upgrade my project built on a 2.0RC version to the 2.0.2 release.

It actually runs fine -- the problem is the unit test project is completely broken. Even a simple "CanGenerateDatabaseSchema" test fails with all of the following errors:

Tests.MyProject.Data.NHibernateMaps.MappingIntegrationTests.CanGenerateDatabaseSchema:
SetUp : NHibernate.MappingException : Unable to instantiate specified event (PostInsert) listener class: NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search
  ----> System.IO.FileLoadException : Could not load file or assembly 'NHibernate, Version=3.2.0.1002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  ----> System.IO.FileLoadException : Could not load file or assembly 'NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

A test which is actually attempting to reach the database fails differently:

Tests.MyProject.Tasks.CategoryTasksTests.CanConfirmDeleteReadiness:
SetUp : System.IO.FileLoadException : Could not load file or assembly 'Castle.Windsor, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

A test which is only operating on Domain logic:

Tests.MyProject.Tasks.TopicTasksTests.CanConfirmDeleteReadiness:
SetUp : System.IO.FileLoadException : Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


I have NH 3.2, NH Search 2.0.2.4, Castle Windsor 3 and verified that when I compile, those DLLs are correctly placed in the bin folder with the test DLL. 

My packages:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Castle.Core" version="3.0.0.4001" />
  <package id="Castle.Windsor" version="3.0.0.4001" />
  <package id="CommonServiceLocator" version="1.0" />
  <package id="CommonServiceLocator.WindsorAdapter" version="1.0" />
  <package id="FluentNHibernate" version="1.3.0.717" />
  <package id="Iesi.Collections" version="3.2.0.4000" />
  <package id="Lucene" version="2.9.2.2" allowedVersions="[2.9.2.2]" />
  <package id="Moq" version="4.0.10827" />
  <package id="MvcContrib.Mvc3.TestHelper-ci" version="3.0.96.0" />
  <package id="Newtonsoft.Json" version="4.0.7" />
  <package id="NHibernate" version="3.2.0.4000" />
  <package id="NHibernate.Search" version="2.0.2.4000" />
  <package id="NUnit" version="2.5.10.11092" />
  <package id="NUnitLib" version="2.5.10.11092" />
  <package id="RhinoMocks" version="3.6" />
  <package id="SharpArch.Domain" version="2.0.2" />
  <package id="SharpArch.NHibernate" version="2.0.2" />
  <package id="SharpArch.Testing.NUnit" version="2.0.2" />
  <package id="SqlServerCompact" version="4.0.8482.1" />
</packages>

Lucene is restricted because NH Search does not seem to be compatible with 2.9.4, but the nuget package for NHS doesn't know that.

I feel like I'm stuck in DLL Hell here... anybody have ideas where I can start looking to resolve this mess? 

Thanks,
Carl

Seif Attar

unread,
Feb 7, 2012, 5:16:17 PM2/7/12
to sharp-arc...@googlegroups.com
Carl, I feel your pain, you are in DLL hell!

The Newtonsoft.Json one I am surprised about, as when you install
4.0.7 it should have added an Assembly redirect to your app.config,
same with Castle WIndsor (CommonServiceLocator is build against 2.5,
but NuGet should have added the redirect) try adding the following to
your test project app.config (and check your web.config has them as
well):

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"
publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.7.0" newVersion="4.0.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Castle.Windsor"
publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>


The nhibernate one I am not sure about, looks to me like the version
of NH.Search you are using is built against an older version of NH,
try adding an assembly redirect for that as well!

Hope this help, let us know how it goes!

> --
> You received this message because you are subscribed to the Google Groups
> "S#arp Architecture" group.
> To post to this group, send email to sharp-arc...@googlegroups.com.
> To unsubscribe from this group, send email to
> sharp-architect...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sharp-architecture?hl=en.

rafay awan

unread,
Feb 8, 2012, 2:52:35 AM2/8/12
to sharp-arc...@googlegroups.com
i have downloaded Templify and created a new project by selecting the "Templify Here" it gave me the option of version 2.0.0.3 i wanted to inquire two things:

> is it the current version
>where did the scaffolding go
--
regards,
Abdul Rafay









Seif Attar

unread,
Feb 8, 2012, 8:26:20 AM2/8/12
to sharp-arc...@googlegroups.com
2.0.0.3 is not the latest version, after you download the templify package from

https://github.com/sharparchitecture/Sharp-Architecture/downloads

You would extract the zip, run the bat file and then you should have a
"Sharp Architecture - 2.0.0" templify package. There was a bad package
uploaded at some points, so maybe that is what you downloaded. Can you
try downloading agian?

The scaffolding project has been removed from SharpArch. And you can
use the MVC4Scaffolding with some customisation of the
RepositoryWithContext template.

There is a blog post explaining how to get this done, unfortunatly we
seem to have lost the DNS record for the Sharp Architecture blog, so I
can't provide a link! :S

I'll let you know when it is back online.

Carl Bussema

unread,
Feb 8, 2012, 10:55:00 AM2/8/12
to sharp-arc...@googlegroups.com
Well there was a binding redirect for NH, and adding the ones for Newtonsoft and Castle Windsor fixed those, but I'm going to have to try compiling NH Search from source against NH 3.2, since it doesn't seem directly compatible.

Two out of three ain't bad... probably :P

rafay awan

unread,
Feb 8, 2012, 10:58:20 AM2/8/12
to sharp-arc...@googlegroups.com
tnx for replying i'm gona do as you have told... and congrats on the new release...

rafay awan

unread,
Feb 8, 2012, 11:13:41 PM2/8/12
to sharp-arc...@googlegroups.com
tnx @seif,  downloading the Templify package from git hub worked for me. I'm a beginner with the sharp architecture and i found a very little help in terms of getting started tutorials and examples. Can you guide me how i can learn it  and use it efficiently, i'm planning to use it in my upcoming project...
--
regards,
Abdul Rafay









Seif Attar

unread,
Feb 9, 2012, 4:47:57 AM2/9/12
to sharp-arc...@googlegroups.com
Glad it worked, you can start at the wiki:

https://github.com/sharparchitecture/Sharp-Architecture/wiki

If you are new to castle/nhibernate I recommend going through their
documentation:

http://stw.castleproject.org/Windsor.MainPage.ashx
http://nhforge.org/doc/nh/en/index.html (Is for an older version of NH
but still relevant)

Reply all
Reply to author
Forward
0 new messages