Bundle-Migration failing
See original GitHub issueI’ve tried to build a migration bundle in my project and it keeps failing with the following error:
‘dotnet-ef migrations bundle -c MyContext --verbose’
C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\NuGet.targets(466,5): error MSB4044: The "GetRestoreProjectStyleTask" task was not given a value for the required parameter "MSBuildProjectName". [C:\Users\daniel.thompson\AppData\Local\Temp\d1f02d5t.l2d\.csproj]
My project builds and runs fine and this gives me the same error in both an admin terminal and the Package Manager Console.
I’ve tried this on a few of the latest different version of net6.0/efcore and have even just tested on the absolute latest nuget Daily Builds with the same results.
Am I missing something simple for the new Migration Bundles? Any ideas?


Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Related StackOverflow Question
For future reference for anyone else; I had this problem when --output was specified as a directory. It seems it must be a filename AND the complete folder path to the file must already exist.
Just an FYI, I managed to solve this issue after playing around a bit more.
@bricelam I agree, I went through everything with a fine tooth comb and none of the error messages I got out made much sense or pointed towards anything meaningful.
The project is far too big to provide any meaningful repro without zipping the whole thing which isn’t an option.
I upgraded both the runtime and the efcore tools to net6 instead of the RC but the issue persisted. So it wasn’t the RC. I then created a new net6 AspNetCore API project and pulled in all of the dependencies, linked to the domain and infra projects where the dbContext in question lived and created a new migration. Worked through the issues that popped up until I could successfully generate a migration bundle in the new test project.
I ended up having to create a more simplified DbContext Ctor (was a stretch based on one of the errors):
I also had to explicitly add some of the EF Core libraries to the infra project file:
I still then encountered the known issue (very annoying) where the project locks the dll in the bin file (https://github.com/dotnet/efcore/issues/25555#issue-972922554) but I used the LockHunter app to unlock the project dll and it finally successfully generated the migration bundle.