question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add-Migration fails on a UWP class library

See original GitHub issue

I moved my model to a class library (along with the context). When I try and run the command:

Add-Migration MyFirstMigration -project Model

I get the following error:

Add-Migration : Exception calling "CreateInstanceAndUnwrap" with "8" argument(s): "Could not load file or assembly 'Microsoft.Framework.Logging.Abstractions, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
At line:1 char:1
+ Add-Migration MyFirstMigration -project GymBuilder.Model
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Migration], MethodInvocationException
    + FullyQualifiedErrorId : FileNotFoundException,Add-Migration

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
emrs-jmcommented, Aug 6, 2015

I found what my issue was. Embedded in my project file it was referencing the old beta5 build. I had to remove it from a text editor since NuGet and Visual Studio weren’t catching it.

You may want to double check the packages folder and make sure that the Microsoft.Framework.Logging.Abstractions folder is present with it’s data for the beta version you are using.

0reactions
hermitdavecommented, Jan 17, 2017

I have given up on using Add-Migration… created Migration file by hand… much better use of my time

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cant run migrations in UWP app
I used Code-First approach and I was able to run my first migration (created the Migrations folder with the migration class and the...
Read more >
UWP + EF core: Unable to add reference to project (cross- ...
When I make a UWP app, and a .NET Standard class library with Entity Framework Core, I should use cross-target like this: <TargetFrameworks>netcoreapp2.0 ......
Read more >
Share code between a desktop application and a UWP app
NET Framework, you can migrate it to a UWP app by leveraging .NET Standard 2.0. Move as much code as you can into...
Read more >
The Secret to Running EF Core 2.0 Migrations from a NET ...
It needs a runtime. A common workaround is that even if you haven't gotten to the UI part of your app yet, to...
Read more >
Migrating a WinUI or UWP class library to an ...
Applying Uno Platform project structure. Adding Uno Platform support to an existing class library entails changing the contents of the existing .csproj file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found