appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 64 forks source link

.NET 8.0 support #3897

Closed Giorgi closed 6 months ago

Giorgi commented 7 months ago

Do you have plans to add support for .NET 8?

OwenMcDonnell commented 7 months ago

Yes!

Giorgi commented 7 months ago

Any timeframe?

georghinkel commented 7 months ago

The workaround from #3745 could still work, but haven't tried (yet)

Giorgi commented 7 months ago

Huh, didn't remember that it was me asking for .NET 6 support :)

georghinkel commented 7 months ago

Unfortunately, that workaround has important limitations:

tompazourek commented 7 months ago

My workaround is this:

before_build:
- choco install dotnet-sdk --version 8.0.100

https://github.com/tompazourek/Rationals/blob/eb30e870c6cd41845bd2b9cf9afc6d75854e640b/.appveyor.yml#L14

Ideally pair it with global.json like:

{
  "sdk": {
    "version": "8.0.100",
    "rollForward": "latestFeature"
  }
}

But I'm also looking forward to the built-in support and waiting for it on some projects.

OwenMcDonnell commented 6 months ago

New Visual Studio 2019 images with .NET 8 are live. Visual Studio 2022 images and updated documentation forthcoming.

plioi commented 6 months ago

I'm not convinced that Visual Studio 2019 images with .NET 8 are live:

dotnet clean src -c Release --nologo -v minimal C:\Program Files\dotnet\sdk\5.0.416\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0.

In general, are .NET SDK updates entirely manual? If an 8.0.* security fix release comes out tomorrow, is the time before getting it in the images measured in hours, or months? Is a human being involved?

OwenMcDonnell commented 6 months ago

I'm not convinced that Visual Studio 2019 images with .NET 8 are live:

dotnet clean src -c Release --nologo -v minimal C:\Program Files\dotnet\sdk\5.0.416\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0.

In general, are .NET SDK updates entirely manual? If an 8.0.* security fix release comes out tomorrow, is the time before getting it in the images measured in hours, or months? Is a human being involved?

Sorry, that's correct. I had to patch the image after deploying it but the patch failed to include the new SDK. I'm in the very human process of re-deploying it now. You can see the history of platform updates here.

OwenMcDonnell commented 6 months ago

New images have been deployed with .NET 8 sdk.

plioi commented 6 months ago

Works for me. Thanks!

For future reference, running the following (Powershell Core) ahead of my main build script works well both before the new deploy and after the new deploy. In the former case, the log would show it installing. In the latter case, it automatically detects that it's already installed, so there's no harm in folks including this "defensively" for the future:

Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile "dotnet-install.ps1"

./dotnet-install.ps1 -InstallDir "$env:ProgramFiles\dotnet" -Channel 8.0 -Quality GA

dotnet --version
yang-xiaodong commented 6 months ago

Hi @OwenMcDonnell ,

Visual Studio 2022 images with .NET 8 are live?

tompazourek commented 6 months ago

Hi @OwenMcDonnell ,

Visual Studio 2022 images with .NET 8 are live?

Just tried it, not yet unfortunately 😞

OwenMcDonnell commented 6 months ago

Sorry there was some shuffling going on to fix an issue that cropped up with nunit on both images. Both Visual Studio 2022 and Visual Studio 2019 images with .NET 8 have been deployed.

tompazourek commented 6 months ago

Confirming, it works now.

@OwenMcDonnell Thank you very much for these updates.

riezebosch commented 6 months ago

waiting for the ubuntu images to be updated as well? thanks for the efforts, btw!