Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 8 Preview Edition Enablement #845

Open
mikependon opened this issue Mar 15, 2023 · 8 comments
Open

.NET 8 Preview Edition Enablement #845

mikependon opened this issue Mar 15, 2023 · 8 comments

Comments

@mikependon
Copy link

.NET 8 Preview has been made available to the public. I started to migrate my OSS library as well to target the net8.0 TFM as well.
Here is the link to the announcement: https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-1/

Currently, the site is not supporting it, but it sounds to me an important one so the public can start test and integrate in advance.

image

Would it be possible to support this and thanks in advance.

@FeodorFitsner
Copy link
Member

You can easily install .NET 8 Preview during the build with this simple script added to your appveyor.yml:

install:
- ps: |
    Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
    & $env:temp\dotnet-install.ps1 -Architecture x64 -Version '8.0.100-preview.2.23157.25' -InstallDir "$env:ProgramFiles\dotnet"

Full gist.

@mikependon
Copy link
Author

Thanks for this trick! It works actual as it builds the project and went passthrough to the next builds.

image

However, it then suddenly failing when the output binaries has been copied over and rebuilt before the actual test executions.

image

Suspecious as well of why I can see the log below, it sounds to me that the path is not correct. If it, then it sounds to me that the .NET 8 version is not instaled on the Node 1.

Project "C:\projects\repodb-yf1cx\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj" (1) is building "C:\projects\repodb-yf1cx\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj" (1:4) on node 1 (Build target(s)).
C:\Program Files\dotnet\sdk\7.0.200\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0.  Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [C:\projects\repodb-yf1cx\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj::TargetFramework=net8.0]
Done Building Project "C:\projects\repodb-yf1cx\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj" (Build target(s)) -- FAILED.
Done Building Project "C:\projects\repodb-yf1cx\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj" (default targets) -- FAILED.

Here is the log file that contains the error. (File: log.txt)
Link: https://ci.appveyor.com/project/mikependon/repodb-yf1cx

@mikependon
Copy link
Author

Below is my YML file.

image

And below is on the site.

image

@FeodorFitsner
Copy link
Member

Try using dotnet msbuild to build RepoDb.UnitTests.csproj directly.

@mikependon
Copy link
Author

Where is that in the YAML? Was it the build: section?

version: 1.0.{build}
branches:
  only:
  - master
image: Visual Studio 2022
configuration: Release
platform: Any CPU
install:
- ps: >-
    Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
        & $env:temp\dotnet-install.ps1 -Architecture x64 -Version '8.0.100-preview.2.23157.25' -InstallDir "$env:ProgramFiles\dotnet"
before_build:
- cmd: dotnet restore RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj
build:
  project: RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj
  verbosity: normal
test_script:
- cmd: vstest.console /logger:Appveyor RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\bin\Release\net7.0\RepoDb.UnitTests.dll

@FeodorFitsner
Copy link
Member

Yes, replace "MSBuild" with "Script" and put there dotnet msbuild RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj

@mikependon
Copy link
Author

The AppVeyor is just a critical integration point to my project and I am very thankful for your support. Few minutes back, and since the .NET 8 is still in a preview mode, I had decided to just revert the support for it (for now), as all my project builds are failing.

But, I will do test again by next week to see if this approach would work and will start reinstating the support to .NET 8.

@Bartleby2718
Copy link

Can be closed now. appveyor/ci#3908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants