hi,

I'm trying to run the tutorial at 
http://www.codeproject.com/KB/database/Nhibernate_Made_Simple.aspx

I downloaded NHibernate 1.2 and copied all the code. When I run it I
get the following exception:

System.IO.FileNotFoundException
            Message="Could not load file or assembly
'NHibernateSimpleDemo' or one of its dependencies. The system cannot
find the file specified."
            Source="mscorlib"
            FileName="NHibernateSimpleDemo"

How do I tell NHibernate to look for my project in the right location?

The full stack trace is:

NHibernate.MappingException was unhandled
  Message="Could not compile the mapping document:
NHibernateTest1.Model.Order.hbm.xml"
  Source="NHibernate"
  StackTrace:
       at NHibernate.Cfg.Configuration.LogAndThrow(MappingException
me)
       at NHibernate.Cfg.Configuration.AddValidatedDocument
(NamedXmlDocument doc)
       at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
       at NHibernate.Cfg.Configuration.AddDocumentThroughQueue
(NamedXmlDocument document)
       at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader
hbmReader, String name)
       at NHibernate.Cfg.Configuration.AddInputStream(Stream
xmlInputStream, String name)
       at NHibernate.Cfg.Configuration.AddResource(String path,
Assembly assembly)
       at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
       at NHibernateSimpleDemo.PersistenceManager.ConfigureNHibernate
() in C:\Documents and Settings\yonatan\Local Settings\Application Data
\Temporary Projects\NHibernateTest1\Persistence
\PersistenceManager.cs:line 226
       at NHibernateSimpleDemo.PersistenceManager..ctor() in C:
\Documents and Settings\yonatan\Local Settings\Application Data
\Temporary Projects\NHibernateTest1\Persistence
\PersistenceManager.cs:line 38
       at NHibernateSimpleDemo.Controller..ctor() in C:\Documents and
Settings\yonatan\Local Settings\Application Data\Temporary Projects
\NHibernateTest1\Controller\Controller.cs:line 12
       at NHibernateSimpleDemo.Program.Main(String[] args) in C:
\Documents and Settings\yonatan\Local Settings\Application Data
\Temporary Projects\NHibernateTest1\Program.cs:line 28
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String
[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: NHibernate.MappingException
       Message="persistent class NHibernateSimpleDemo.Order,
NHibernateSimpleDemo not found"
       Source="NHibernate"
       StackTrace:
            at NHibernate.Cfg.HbmBinder.ClassForFullNameChecked(String
fullName, String errorMessage)
            at NHibernate.Cfg.HbmBinder.BindClass(XmlNode node,
PersistentClass model, Mappings mappings)
            at NHibernate.Cfg.HbmBinder.BindRootClass(XmlNode node,
RootClass model, Mappings mappings)
            at NHibernate.Cfg.HbmBinder.BindRoot(XmlDocument doc,
Mappings mappings)
            at NHibernate.Cfg.Configuration.AddValidatedDocument
(NamedXmlDocument doc)
       InnerException: System.IO.FileNotFoundException
            Message="Could not load file or assembly
'NHibernateSimpleDemo' or one of its dependencies. The system cannot
find the file specified."
            Source="mscorlib"
            FileName="NHibernateSimpleDemo"
            FusionLog="=== Pre-bind state information ===\r\nLOG: User
= LOGIC\\Yonatan\r\nLOG: DisplayName = NHibernateSimpleDemo\n (Partial)
\r\nLOG: Appbase = file:///C:/Documents and Settings/yonatan/Local
Settings/Application Data/Temporary Projects/NHibernateTest1/bin/Debug/
\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : NHibernate,
Version=1.2.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.\r
\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No
application configuration file found.\r\nLOG: Using machine
configuration file from c:\\WINDOWS\\Microsoft.NET\\Framework\
\v2.0.50727\\config\\machine.config.\r\nLOG: Policy not being applied
to reference at this time (private, custom, partial, or location-based
assembly bind).\r\nLOG: The same bind was seen before, and was failed
with hr = 0x80070002.\r\n"
            StackTrace:
                 at System.Reflection.Assembly._nLoad(AssemblyName
fileName, String codeBase, Evidence assemblySecurity, Assembly
locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound,
Boolean forIntrospection)
                 at System.Reflection.Assembly.nLoad(AssemblyName
fileName, String codeBase, Evidence assemblySecurity, Assembly
locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound,
Boolean forIntrospection)
                 at System.Reflection.Assembly.InternalLoad
(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&
stackMark, Boolean forIntrospection)
                 at System.Reflection.Assembly.InternalLoad(String
assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark,
Boolean forIntrospection)
                 at System.Reflection.Assembly.Load(String
assemblyString)
                 at NHibernate.Util.ReflectHelper.TypeFromAssembly
(AssemblyQualifiedTypeName name, Boolean throwOnError)
                 at NHibernate.Util.ReflectHelper.ClassForName(String
name)
                 at NHibernate.Cfg.HbmBinder.ClassForFullNameChecked
(String fullName, String errorMessage)
            InnerException:

--

You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=.


Reply via email to