diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index c17018cd..e6c58770 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -68,6 +68,24 @@ jobs: - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.3.1 + # Restore dependencies + - name: Restore Dependencies + run: dotnet restore ${{ matrix.solution }} + env: + NUGET_CONFIG_PATH: ./NuGet.Config + + # Ensure .NET Framework MSBuild is used if required + - name: Validate .NET Framework Compatibility + if: always() + run: | + if (${{ matrix.solution }} -match '\.NETFramework') { + Write-Host "Using MSBuild for .NET Framework." + msbuild ${{ matrix.solution }} /t:Restore /p:Configuration=${{ matrix.configuration }} + } else { + Write-Host "Using .NET Core for Restore." + dotnet restore ${{ matrix.solution }} + } + # Execute all unit tests in the solution - name: Execute Unit Tests run: dotnet test ${{ matrix.solution }} -c ${{ matrix.configuration }} /nowarn:CS0067,CS0108,CS0109,CS0114,CS0169,CS0414,CS0649,CA1416,NU5104,NETSDK1138,SYSLIB0003