1
我有一個MVC項目,我有一個類庫設置作爲我的測試項目。然而,使用NUnit運行我的測試時,抱怨沒有找到Nhibernate.config(這是在我的Web項目斌Nunit抱怨Nhibernate.config文件丟失?
確切的錯誤:
<solutionName>.UnitTests.CatelogEditing.Can_View_All_Products_On_Admin_Product_List:
System.TypeInitializationException : The type initializer for '<solutionName>.Domain.Infrastructure.BootStrapper' threw an exception.
----> NHibernate.Cfg.HibernateConfigException : An exception occurred during configuration of persistence layer.
----> System.IO.FileNotFoundException : Could not find file '<myrootpath>.UnitTests\bin\Debug\nhibernate.config'.
任何幫助是極大的讚賞。
我已經複製了它,但沒有意識到屬性會默認回來。所以構建操作和複製設置不到位。 – pghtech 2010-11-18 17:15:19
任何想法,一旦我得到了這個錯誤,單位想抱怨,它找不到「命名連接字符串」,並列出我的電腦名稱。我正在使用「cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionStringName,System.Environment.MachineName);」在我的CreateSessionFactory方法中,並添加了屬性「name =」到我的Web.config中。 –
pghtech
2010-11-18 18:07:21