我将我的MVC3项目升级到MVC4没有太大麻烦但是Web API(我之所以这样做的原因)没有用,因为显然有一些引用NHibernate的东西。
<Exception>
<ExceptionType>System.IO.FileNotFoundException</ExceptionType>
<Message>Could not load file or assembly 'NHibernate, Version=3.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.</Message>
<StackTrace>
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at System.Web.Http.Dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)
at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)
at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()
at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.InitializeControllerInfoCache()
at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncInternal(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
</StackTrace>
</Exception>
我删除了对NHibernate的引用,因为我尝试将FunnelWeb博客添加到我的网站,但我在同一个项目中最终得到了两个完全不同的做法,我完全不喜欢它。
我不认为将NHibernate库再次放置是一个好主意,因为我会隐藏一些我应该知道的东西。
我尝试过NDepend但是没有找到NHibernate。
请注意,我的项目正在编译并正常运行。有什么想法吗?
答案 0 :(得分:1)
您是否尝试删除bin目录?
答案 1 :(得分:0)
解决方案显而易见。有一个引用NHibernate的FunnelWeb糟糕的dll。