开发者

NHibernate with MVC 2 Deployment issue

I am deploying Asp.Net MVC 2 application on Windows Server 2003. I am using NHibernate for data access.

When I deployed this application on Windows server 2003 and browse to it the application thro开发者_高级运维ws an exception saying "hibernate.cfg.xml not found under Windows/System32/inetsrv."

Why NHibernate is searching Windows/System32/inetsrv rather than loading "hibernate.cfg.xml" from the bin folder?

Thanks


I'm guessing that your app is looking for the file in the webapp root.

When nhibernate loads your config file you need to set the path to config file with Server.MapPath(@"~/bin/nhibernate.cfg.xml").

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜