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.  [ 2 posts ] 
Author Message
 Post subject: Method not found:CompilerServices.RuntimeHelpers.GetHashCode
PostPosted: Wed Jul 05, 2006 5:23 pm 
Newbie

Joined: Wed Jul 05, 2006 5:13 pm
Posts: 2
I like the little template :).

I'm getting the following exception when testing some code with NUnit:
Method not found: Int32 System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode

If it matters, this is an ASP.NET project. I have used NHibernate successfully with a Windows Forms project recently. However I'm am NHibernate beginner, so please forgive any obvious mistakes :)

I hope this all explains my problem properly.

Thanks :)

Hibernate version: 1.2.1001

Mapping documents:

Quote:
<?xml version="1.0" encoding="utf-8"?>

<!--Generated from NHibernate.Mapping.Attributes on 2006-07-04 11:59:34Z.-->

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">

<class name="QuickLawInvoice.Data.InvoiceEntry, QuickLawInvoice">
<id name="InvoiceEntryId" type="Int32">
<generator class="identity" />
</id>
<property name="LawDatabase" />
<property name="Date" />
<property name="Time" />
<property name="Duration" />
<property name="Charges" />
</class>

<class name="QuickLawInvoice.Data.InvoiceSection, QuickLawInvoice">
<id name="InvoiceSectionId" type="Int32">
<generator class="identity" />
</id>
<property name="ClientId" />
<property name="ReceivedLbi" />
<property name="CreatedInvoice" />
<property name="CostCenterId" />
<property name="GlId" />
<bag name="Entries" cascade="save-update">
<key column="InvoiceSectionId" />
<one-to-many class="QuickLawInvoice.Data.InvoiceEntry, QuickLawInvoice" />
</bag>
</class>

<class name="QuickLawInvoice.Data.InvoiceSpreadsheet, QuickLawInvoice">
<id name="InvoiceSpreadsheetId" type="Int32">
<generator class="identity" />
</id>
<property name="UploadDate" />
<property name="InvoiceDate" />
<property name="QuickLawInvoiceNumber" />
<bag name="Sections" cascade="save-update">
<key column="InvoiceSpreadsheetId" />
<one-to-many class="QuickLawInvoice.Data.SectionData, QuickLawInvoice" />
</bag>
</class>

<class name="QuickLawInvoice.Data.PersonData, QuickLawInvoice">
<id name="PersonDataId" type="Int32">
<generator class="identity" />
</id>
<property name="Name" />
<property name="Email" />
<bag name="Invoices" cascade="save-update">
<key column="PersonDataId" />
<one-to-many class="QuickLawInvoice.Data.InvoiceSection, QuickLawInvoice" />
</bag>
</class>

<class name="QuickLawInvoice.Data.SectionData, QuickLawInvoice">
<id name="SectionDataId" type="Int32">
<generator class="identity" />
</id>
<property name="Name" />
<property name="ApproverName" />
<property name="ApproverEmail" />
<bag name="People" cascade="save-update">
<key column="SectionDataId" />
<one-to-many class="QuickLawInvoice.Data.PersonData, QuickLawInvoice" />
</bag>
</class>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Quote:
ITransaction transaction = session.BeginTransaction();

session.Save( s );

transaction.Commit();


Full stack trace of any exception that occurs:
Quote:
TestCase 'TimeKeeper.Test.DatabaseTest.testSave'
failed: System.MissingMethodException : Method not found: Int32 System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(System.Object).
at NHibernate.IdentityHashCodeProvider.GetHashCode(Object obj)
at System.Collections.Hashtable.GetHash(Object key)
at System.Collections.Hashtable.get_Item(Object key)
c:\net\nhibernate\nhibernate\src\NHibernate\Util\SequencedHashMap.cs(276,0): at NHibernate.Util.SequencedHashMap.get_Item(Object o)
c:\net\nhibernate\nhibernate\src\NHibernate\Util\IdentityMap.cs(196,0): at NHibernate.Util.IdentityMap.get_Item(Object key)
c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs(662,0): at NHibernate.Impl.SessionImpl.GetEntry(Object obj)
c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs(703,0): at NHibernate.Impl.SessionImpl.Save(Object obj)
u:\craig-work\quicklawinvoice\test\databasetest.cs(47,0): at TimeKeeper.Test.DatabaseTest.testSave()


Name and version of the database you are using:

MS SQL 2000

The generated SQL (show_sql=true): Mmm, not certain.

Debug level Hibernate log excerpt: Empty.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 3:36 pm 
Newbie

Joined: Wed Jul 05, 2006 5:13 pm
Posts: 2
Well...it seems that if I close Visual Studio and open it again, the problem disappears for a short while. It doesn't sound like an NHibernate problem anymore.

If anyone has any thoughts anyway, I'd love to hear them. As much as I love restarting VS every 10 minutes or so...:)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.