Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 639
NATO24 Avatar asked May 21 '12 19:05

NATO24


1 Answers

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).

like image 168
Maxim Avatar answered Sep 22 '22 18:09

Maxim