question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with dotnet ef migrations bundle when using v3

See original GitHub issue

Description: 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:closed
  • Created 10 months ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
IvanZosimovcommented, Dec 6, 2022

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.

1reaction
IvanZosimovcommented, Nov 10, 2022

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 the dotnet ef tool only on the windows-latest image (same when using v3/v2). You can check that on windows-2019 everything works perfectly: successful run - windows-2019. Unfortunately, I can’t suggest you use windows-2019 as a workaround because your target .NET SDK is 6, but there is no preinstalled 6 version on windows-2019. As a conclusion, I’ll redirect this issue to the team which maintains OS images.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found