Skip to content

Add-Migration doesn't work in a UWP project with EF Core 1.0.1 #6551

@qmatteoq

Description

@qmatteoq

Steps to reproduce

  1. Install the packages required to use EF Core in a UWP application by following the guideline explained here: http://ef.readthedocs.io/en/latest/platforms/uwp/
  2. Notice that, by default, NuGet install the last version of the package, which is 1.0.1
  3. Follow the tutorial to create the model and the DbContext class
  4. Run the NuGet command to perform the migration
Add-Migration MyFirstMigration

The issue

The migration fails with the following exception

Add-Migration : Exception calling "CreateInstanceAndUnwrap" with "8" argument(s): "Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its 
dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
At line:1 char:1
+ Add-Migration MyFirstMigration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Migration], MethodInvocationException
    + FullyQualifiedErrorId : FileLoadException,Add-Migration

The only way to get the migration working is to revert back all the NuGet packages to version 1.0.0

Further technical details

EF Core version: 1.0.1
Operating system: Windows 10 14393.105
Visual Studio version: Visual Studio 2015 Update 3

Other details about my project setup: Simple project created for test purposes, with just one entity and some basic operations (Inserting and retrieving data).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions