GithubAction with .NET 4 framework

Viewed 68

Is it possible to create a GithubAction for building an old .NET 4 based app?

I've created such pipeline:

name: EZRep Build

on:
  push:
    branches: master

jobs:
  build:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2
    
    - name: Setup MSBuild
      uses: microsoft/setup-msbuild@v1

    - uses: nuget/setup-nuget@v1
      with:
        nuget-api-key: ${{ secrets.NuGetAPIKey }}
        nuget-version: '5.x'
      
    - name: Navigate to Workspace
      run: cd $GITHUB_WORKSPACE

    - name: Create Build Directory
      run: mkdir _build


    - name: Restore Packages
      run: nuget restore MazeBallWeb/MazeBall.sln

    - name: Build Solution
      run: |
        msbuild.exe MazeBallWeb/MazeBall.sln /nologo /nr:false /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release" /p:PublishUrl="../_build"
        

But the last step fails with en error: error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpack...

Is it possible to configure .NET SDK 4 on the windows runner? I need an old .NET4 not a.NET core

1 Answers
Related