EF添加迁移抛出System.OutOfMemoryException

rhu*_*ter 8 c# entity-framework out-of-memory

当我尝试通过PM添加迁移文件时,我得到内存不足异常.其他人之前遇到过这个问题并碰巧知道如何修复它?到目前为止,我已经尝试重新安装VS 2013无济于事

监视我的内存使用情况我有12GB可用,并且在添加迁移运行时使用的内存少于8,所以应该可以使用.以下是输出

PM> add-migration test
Run Code Online (Sandbox Code Playgroud)

System.OutOfMemoryException:抛出了类型'System.OutOfMemoryException'的异常.在
System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)的System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)处于System.Data.Entity.Migrations.Design.ToolingFacade.Scaffold(String migrationName,String language,String)位于System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name,Boolean force,Boolean ignoreChanges)的System.Data.Entity.Migrations.AddMigrationCommand.<> c__DisplayClass2.<.ctor> b__0()at的rootNamespace,Boolean ignoreChanges) System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)抛出了类型'System.OutOfMemoryException'的异常.

Cia*_*her 16

在这种情况下,只需重新启动Visual Studio即可.

  • 是的,重新启动后对我有用。这就是为什么我们认为“重启”是一种神奇的解决方案! (2认同)

rhu*_*ter 4

只是在这里留下注释,以防有人遇到同样的错误。我现在已经解决了这个问题。我禁用了 ReSharper,它开始工作。然后我重新启用了 re Sharper 并清除了其缓存,现在在启用了 re Sharper 的情况下它仍然可以继续工作。感谢 magicandre1981 为我指明了加载项。

编辑:我使用的 ReSharper 版本是 8.2 c# 版本,内部版本 8.2.0.2160