EF 4.3.1 IMigrationMetadata.Target strings are causing “No logical space left to create more user strings.” compile errors

一笑奈何 提交于 2020-01-13 09:04:10

问题


We've generated ~80 migrations since the release of the 4.3.x version of Entity Framework. Each time we generate a new migration, EF gens a snapshot of the current model for the IMigrationMetadata.Target property.

Since each migration is adding ~135k characters to our assembly, we are starting to hit critical mass. We're now receiving a "No logical space left to create more user strings." compiler error. Combine that w/ the pre-compile views, and you've got a lot of strings.

What's the best long term approach to using EF migrations with a complex model?

Maybe add-migration should be generating these w/ resource files.


回答1:


Thanks for reporting this. I have added this issue to our backlog for EF6.

For now, replacing the string with a resource lookup is the best workaround I can think of.




回答2:


we had the same issue. We are also fix this using moving the generated string into resource:

 public sealed partial class RegionalCenterRenameClass : IMigrationMetadata
 { 
  // Skipped code

  string IMigrationMetadata.Target
  {
    get { return Targets.M201207110918331_RegionalCenterRenameClass; }
   }
 }

where Targets - is resource file (resx).



来源:https://stackoverflow.com/questions/10691155/ef-4-3-1-imigrationmetadata-target-strings-are-causing-no-logical-space-left-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!