Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

How to build project targeting Net35 with GitHub Actions

Solved! Go to Solution.

I have a project that targets .NET Framework 3.5. How do I build it in a GitHub Actions workflow?
There is an action for setting up a dotnet core environment: Is there something similar to Net35? Or some other way to do it?

1 Reply
Highlighted
Solution
GitHub Partner
Message 2 of 2

Re: How to build project targeting Net35 with GitHub Actions

You can call "msbuild.exe" which is installed on "Windows Server 2019" and "Windows Server 2016 R2" virutal environments to build .Net Framework projects.

 

Here is the example to call msbuild to build the project with "Windows Server 2019" runner:

jobs:
  build:
    runs-on: windows-2019
    steps:
      - name: checkout
        uses: actions/checkout@v1
      - name: Build DotNET35
        run: |
           cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\"
           .\MSBuild.exe $Env:GITHUB_WORKSPACE\pathtoyoursolutionorproject

If you want to run the workflow with "Windows Server 2016 R2", change the path to:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\