Add-migration Build Failed

Raymart Casil Atienza 36 Reputation points
2022-12-26T16:29:59.61+00:00

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!

Developer technologies .NET Entity Framework Core
Windows development Windows App SDK
Developer technologies C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.