Error with dotnet ef migrations bundle when using v3
See original GitHub issueDescription: We upgraded our GitHub workflow from setup-dotnet@v1 to setup-dotnet@v3 and started seeing an error in the “dotnet ef migrations bundle” command, as detailed in the GitHub issue I raised against the efcore repo:
https://github.com/dotnet/efcore/issues/29491
Downgrading to setup-dotnet@v2 resolves the issue.
Task version: v3
Platform:
- Windows
Runner type:
- Hosted
Repro steps:
- name: Set up .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Install EF Tool
run: |
dotnet new tool-manifest
dotnet tool install dotnet-ef
... build and publish solution ...
- name: Generate EF migration script
run: dotnet ef migrations bundle --startup-project Puckster.Server --output ./efbundle.exe --configuration Bundle --verbose
Expected behavior: efbundle.exe is generated successfully.
Actual behavior:
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.10\Sdk\WasmApp.targets(161,5): error : $(MicrosoftNetCoreAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=. One of these need to be set to a valid path [D:\a\puckster\puckster\Puckster.Client\Puckster.Client.csproj]
Issue Analytics
- State:
- Created 10 months ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
EF Core add-migration Build Failed - Stack Overflow
when running add-migration in a .NET Core EF project, with no explanation of why the build failed. How do you troubleshoot this error?...
Read more >Running EF Core Migration Bundle on Alpine Linux
Entity Framework Core Migration Bundles can greatly ease the process of applying database changes during the deployment of your application.
Read more >Applying Migrations - EF Core - Microsoft Learn
Strategies for applying schema migrations to production and development databases using Entity Framework Core.
Read more >Migrations and Seed Data With Entity Framework Core
We are going to learn about Migrations and Seed data in Entity Framework Core and how to optimize EF Core migrations.
Read more >Working with DevOps friendly EF Core Migration Bundles
Currently you can deploy your EF Core migrations either using Code ... or Visual Studio, the dotnet ef migrations bundle command may fail....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, @mabster! Yes, you’re right. You can put it into the root of your repo or in any other folder and then specify its path in
global-json-file
input.Hi, @mabster 👋 After some investigation I came to the conclusion, that the root cause of the problem is not in our action, but it’s in the OS that runs the action. The default location of the preinstalled .NET SDKs is:
C:/Program Files/dotnet
. Somehow, this location is not accessible for thedotnet ef
tool only on thewindows-latest
image (same when using v3/v2). You can check that onwindows-2019
everything works perfectly: successful run - windows-2019. Unfortunately, I can’t suggest you usewindows-2019
as a workaround because your target .NET SDK is 6, but there is no preinstalled 6 version onwindows-2019
. As a conclusion, I’ll redirect this issue to the team which maintains OS images.