Beginner |
|
Joined: Mon Mar 06, 2006 2:19 pm Posts: 42 Location: Belo Horizonte, Brazil
|
There is one thing that I didn't see here for helping this exception.
When you try: cfg.AddAssembly("NameOfYourAssembly");
You maybe can think: "What assembly? My assembly is my own project." Well, if you followed the quickstart you're right, your persistence classes are part of the project and are not in a separate dll. So you need to know what is the assembly name of your project. Look at the Project->Properties. There is a field called "Assembly name". Fill the *.hbm.xml files and cfg.AddAssembly with it.
e.g:
Project Assebly Name: MyProject (look at Project->Properties)
hbm.xml file:
<class name="Animals.Dog, MyProject" table="dog">
Here Animals is your namespace, Dog is your class and MyProject is your assembly.
code:
cfg.AddAssembly("MyProject");
This is basic but can help a beginner. There is a lot of other posts here discussing the same problem.
note: You can embed your *.hbm.xml files but I think you must not embed the app.config file[/b]
|
|