Oryx - The framework 'Microsoft.NETCore.App', version '3.1.0' was not found

1.1k Views Asked by At

When using GitHub Actions to build my Azure Static Web App, the following oryx errors are produced

It was not possible to find any compatible framework version 
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found. 
  - The following frameworks were found: 
      5.0.6 at [/tmp/oryx/platforms/dotnet/5.0.203/shared/Microsoft.NETCore.App] 
You can resolve the problem by installing the specified framework and/or SDK. 
The specified framework can be found at: 
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=debian.9-x64 
Metadata generation failed. 

Oryx errors seem to indicate .NET Core 3.1.0 is unavailable, the following was attempted in the build script,

  • dotnet-version: '3.1.x' The framework 'Microsoft.NETCore.App', version '3.1.0' was not found
  • dotnet-version: '3.1.0' Could not find .NET Core SDK with version = 3.1.0

This might be a duplicate of .NET 5 - The framework 'Microsoft.NETCore.App', version '3.1.0' was not found, but was unsuccessful at adding the missing SDK. The Oryx team recently merged changes to add .NET Core 3.1 SDK https://github.com/microsoft/Oryx/issues/1032.

Dotnet Core Csproj

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.3.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.3" OutputItemType="Analyzer" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.4" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

Build Script

name: Azure Static Web Apps CI/CD

on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened, closed]
    branches:
      - master

jobs:
  build_and_deploy_job:
    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
    runs-on: ubuntu-latest
    name: Build and Deploy Job
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/setup-dotnet@v1
        with:
          dotnet-version: '3.1.x'
      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets}}
          repo_token: ${{ secrets}}
          action: "upload"
          app_location: "Client"
          api_location: "Api"
          output_location: "wwwroot"

  close_pull_request_job:
    if: github.event_name == 'pull_request' && github.event.action == 'closed'
    runs-on: ubuntu-latest
    name: Close Pull Request Job
    steps:
      - name: Close Pull Request
        id: closepullrequest
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets}}
          action: "close"

Oryx Build Log

Oryx Version: 0.2.20210410.1, Commit: e73613ae1fd73c809c00f357f8df91eb984e1158, ReleaseTagName: 20210410.1

Build Operation ID: |CKsa7CC9RZs=.1df8a945_
Repository Commit : 95e1079c5ea6bee2df8c47e2dd98d10d18313ca2

Detecting platforms...
Detected following platforms:
  dotnet: 5.0.6


Source directory     : /github/workspace/Api
Destination directory: /bin/staticsites/ss-oryx/api


Using .NET Core SDK Version: 5.0.203
  Determining projects to restore...
  Restored /github/workspace/Api/Api.csproj (in 7.54 sec).
  1 of 2 projects are up-to-date for restore.

Publishing to directory /bin/staticsites/ss-oryx/api...

Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  Data -> /github/workspace/Data/bin/Release/netstandard2.1/Data.dll
  Api -> /github/workspace/Api/bin/Release/net5.0/Api.dll
  Determining projects to restore...
  Restored /tmp/txcrqp1l.xyi/WorkerExtensions.csproj (in 3.18 sec).
  WorkerExtensions -> /tmp/txcrqp1l.xyi/buildout/Microsoft.Azure.Functions.Worker.Extensions.dll
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : It was not possible to find any compatible framework version [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The framework 'Microsoft.NETCore.App', version '3.1.0' was not found. [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :   - The following frameworks were found: [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :       5.0.6 at [/tmp/oryx/platforms/dotnet/5.0.203/shared/Microsoft.NETCore.App] [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : You can resolve the problem by installing the specified framework and/or SDK. [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The specified framework can be found at: [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=debian.9-x64 [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
/var/nuget/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed. [/tmp/txcrqp1l.xyi/WorkerExtensions.csproj]
0

There are 0 best solutions below