I downloaded the latest v15.1 and am trying to get it to run. I am using Visual Studio 2026 and even just in the basic demo app I keep getting this error when trying to run Update-Database.
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: D:\BBG\Sessions 15.1\aspnet-core\src\BBG.Sessions.Web.Core\BBG.Sessions.Web.Core.csproj : warning NU1510: PackageReference Microsoft.AspNetCore.DataProtection.Abstractions will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\BBG\Sessions 15.1\aspnet-core\src\BBG.Sessions.Web.Host\BBG.Sessions.Web.Host.csproj]
Any ideas?
7 Answer(s)
-
0
Hi @emorin
Thank you for reporting the issue. This error occurs because the
ErrorActionPreferencevariable is set toStopin the PowerShell session of Visual Studio’s Package Manager Console. In this case, the NU1510 warning generated by NuGet is treated as an error and interrupts the execution flow.To resolve this issue, you can use one of the following methods:
Use the
dotnet efcommand from the terminal (recommended)Instead of using the Package Manager Console, open a terminal window and run the following command:
cd src/YourProjectName.Web.Host or cd src/YourProjectName.Web.Mvc dotnet ef database update --project ../YourProjectName.EntityFrameworkCore/YourProjectName.EntityFrameworkCore.csprojWith this approach, the
ErrorActionPreferenceissue will not occur.Remove the unnecessary package
Remove the following line from the
YourProjectName.Web.Core.csprojfile:<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="10.0.0" />This package is already included transitively through another dependency, so adding it as a direct reference is not required.
This issue will be resolved with the update included in version 15.2. Thank you.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Using the dotnet ef is the way to go now since using Package Manager now has more warnings not just this one. Maybe update the docs.
Also, I needed to add back Microsoft.EntityFrameworkCore.Design to the host project to get it to work.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @emorin
Yes, you're right, you can see the fix pull request here. You can make a correction based on that, and this problem will be resolved in the new version. Thank you.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I am experiencing the exact same issue.
Even in a clean ASP.NET Zero v15 project, Update-Database and migrations are not working properly. The Package Manager Console stops with the same ErrorActionPreference error caused by the NU1510 warning.
Honestly, v14 was much smoother and more developer-friendly. With v15, basic development workflows became unnecessarily complicated.
After purchasing the v15 license, I am quite disappointed because:
The code generator did not work properly
Migrations cannot be executed easily
Package Manager Console commands frequently fail due to warnings being treated as errors
These are very core development features, and when they don't work smoothly, it becomes very frustrating to use the framework.
If we cannot easily run migrations or rely on the code generator, it significantly reduces the value of upgrading from v14.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @sailoper
Thank you for sharing your experience, and we apologize for the inconvenience you encountered.
The issue you mentioned has been addressed in ASP.NET Zero v15.2, which was recently released. In this version, the migration problems and the NU1510 warning causing
ErrorActionPreferencefailures in Package Manager Console have been resolved.With these fixes and several additional improvements, v15.2 provides a more stable and consistent development experience compared to earlier v15 releases.
We are continuously working on improvements and feedback from developers like you helps us make the platform better with each release. We recommend updating your project to v15.2 to benefit from these fixes and enhancements.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
ASP.NET Zero v15.2 is better than 15.1 but since now Package Manager treats vulnerable packages as errors it pretty much means we have to switch to use dotnet ef command in terminal.
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: D:\15.2\aspnet-core\src\Sample.EntityFrameworkCore\Sample.EntityFrameworkCore.csproj : warning NU1902: Package 'MimeKit' 4.15.0 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-g7hc-96xr-gvvx [D:\Sessions 15.2\aspnet-core\src\Sample.Web.Host\Sample.Web.Host.csproj]
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @emorin
We actually fixed this issue with version 15.2, but a vulnerability has also been detected in version 4.15.0 of the
MimeKitpackage. Thank you for reporting this to us. We will fix it. To temporarily resolve this issue in your project, you can temporarily update the MimeKit package, which is a Transitive Package, at the Top Level where necessary.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)