Note that there are some explanatory texts on larger screens.

plurals
  1. POEF 5.0 Enums Not Generating
    text
    copied!<p><strong>BACKGROUND</strong> I'm using VS 2010 on a machine where I installed .Net 4.5 which I've read was an in-place install (overrode the .net 4.0 version).</p> <p>I have projects still targeting 4.0 and 4.5 option is not available but was told it's ok since 4.5 was an in-place install. I then installed EntityFramework -pre via nuget and notices when I ran Upgrade-Database -Script commands, it would not generate enum properties.</p> <p>I then found <a href="http://thedatafarm.com/blog/data-access/moving-projects-from-ef-4-1-2-3-ndash-gt-ef5beta-don-rsquo-t-do-what-i-did/" rel="nofollow">this</a>. I tried doing everything from scratch again but it was still adding EntityFramework 4.4 instead of 5.0. So I manually changed all references to point to the 5.0 version to make sure I have EF 5.0 version. All compiled. </p> <p><strong>PROBLEM</strong> When I run </p> <pre><code>Enable-Migrations -EnableAutomaticMigrations </code></pre> <p>I get "<em>No classes deriving from DbContext found in the current project. Edit the generated Configuration class to specify the context to enable migrations for.</em>"</p> <p>So I manually made sure that my class is correct as in:</p> <pre><code>internal sealed class Configuration : DbMigrationsConfiguration&lt;DataContext&gt; { public Configuration() { AutomaticMigrationsEnabled = true; } </code></pre> <p>DataContext subclasses DbContext.</p> <p>When I run</p> <pre><code>Update-Database -Script </code></pre> <p>I get "<em>No migrations configuration type was found in the assembly 'MyProject'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).</em>"</p> <p>MyProject does have the configuration class I mentioned above and in Package Manager Console I am choosign the right dropdown for my project containing Migrations folder and this Configuration class.</p> <p><strong>QUESTION</strong></p> <ol> <li><p>What do I do to make sure when I install EnittyFramework via nuget that it adds the 5.0 version and not 4.4 even though I have .Net 4.5 installed? </p></li> <li><p>If I can't do anything related to the question above, what can I do to make sure Upgrade-Database spit out a script?</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload