Add-migration Build Failed

Raymart Atienza 1 Reputation point

When using EF Core 7's Add-Migration cmdlet, I encounter this error:

An assembly specified in the application dependencies manifest (MyProject.deps.json) was not found:
package: 'runtimepack.Microsoft.Windows.SDK.NET.Ref', version: '10.0.22621.28'
path: 'Microsoft.Windows.SDK.NET.dll

I am using VS 2022 (17.4.3) on a Windows 11 22H2 PC. I used the project template "Class Library (WinUI 3 in Desktop)".
Target Framework: net7.0-windows10.0.22621.0
TargetPlatformMinVersion: 10.0.22621.0

Before creating the necessary C# classes, I downloaded and installed the following packages via NuGet:
Microsoft.EntityFrameworkCore.Design 7.0.1
Microsoft.EntityFrameworkCore.SqlServer 7.0.1
Microsoft.EntityFrameworkCore.Tools 7.0.1

On my solutions explorer, I can verify that Microsoft.Windows.SDK.Net.Ref ver. 10.0.22621.28 is installed and added as a project dependency.
I have the latest version of the Windows App SDK, .Net 7 SDK, Windows App SDK C# Templates, etc.

My project is building just fine. No build errors.

Can someone please help? Thanks!

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,992 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
438 questions
{count} votes