NHibernate.MappingException: Association references unmapped class

by Oliver 2. October 2008 09:43

Gestern Abend kamen die CustomLinks dazu: neue Klasse, neue DB-Tabelle, neues Mapping. NHibernate-Mappings kopiere ich immer und passe sie dann an. Alles lief super.

Die Tests liefen super.

Heute morgen fiel mir auf, dass meine Klasse ja noch ein Type-Feld braucht. Ok, kein Ding.

Feld hinzugefügt, Zeile im Mapping-File hinzugefügt, Eigenschaft in den Tests gesetzt (not-null hatte ich auf "true") und los.

Und dann bekam ich obige Exception: NHibernate.MappingException: Association references unmapped class: CustomLink.

Kann ja nicht sein!

Hin und her probiert, schließlich das Orakel gefragt und siehe da: Man muss in den Properties des Mapping-Files die Build Action auf Embedded Resource setzen. Das war noch nicht der Fall. Danach klappte es.

Nur warum hat es gestern funktioniert?!

enjoyed the post?

Tags:

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About Oliver

shades-of-orange.com code blog logo I build web applications using ASP.NET and have a passion for javascript. Enjoy MVC 4 and Orchard CMS, and I do TDD whenever I can. I like clean code. Love to spend time with my wife and our children. My profile on Stack Exchange, a network of free, community-driven Q&A sites

About Anton

shades-of-orange.com code blog logo I'm a software developer at teamaton. I code in C# and work with MVC, Orchard, SpecFlow, Coypu and NHibernate. I enjoy beach volleyball, board games and Coke.