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 5 compatibility #5

Closed
AndreasAmMueller opened this issue Dec 20, 2020 · 3 comments
Closed

.NET 5 compatibility #5

AndreasAmMueller opened this issue Dec 20, 2020 · 3 comments

Comments

@AndreasAmMueller
Copy link

I recently created a .NET 5 project and enabled CI/CD on gitlab to deploy the website (MVC) automatically after build.
This failed due to an un-met dependency (Microsoft.NETCore.App v2.0.0).

I think, this might not only happen for .NET 5 projects but for other CD builds too (not tested yet).
The variables are correct and contain the right content (double checked before writing the issue).

See the build log:

Running with gitlab-runner 13.6.0 (8fa89735)
  on runner-lnx 702596f4

Preparing the "docker" executor
Using Docker executor with image mcr.microsoft.com/dotnet/sdk:latest ...
Pulling docker image mcr.microsoft.com/dotnet/sdk:latest ...
Using docker image sha256:30ff27efc8135487307b5af9c6440c7b0c10805cd1559a6442117b8ef6048ddd for mcr.microsoft.com/dotnet/sdk:latest with digest mcr.microsoft.com/dotnet/sdk@sha256:016b59e671867d6be26a7994c2a39dd142a09b8651dccb2318fa70bc64cca4a0 ...

Preparing environment
Running on runner-702596f4-project-19-concurrent-0 via e98bf8b66814...

Getting source from Git repository
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/AM.WD/CovidTable/.git/
Created fresh repository.
Checking out 2fc1ad76 as v1.4.0...

Skipping Git submodules setup

Executing "step_script" stage of the job script
$ dotnet restore
  Determining projects to restore...
  Restored /builds/AM.WD/CovidTable/CovidTable.csproj (in 13.18 sec).
  Restored /builds/AM.WD/CovidTable/CovidTable.csproj (in 15.02 sec).
$ dotnet publish --no-restore -c Release
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  CovidTable -> /builds/AM.WD/CovidTable/bin/Release/CovidTable.dll
  CovidTable -> /builds/AM.WD/CovidTable/bin/Release/CovidTable.Views.dll
  CovidTable -> /builds/AM.WD/CovidTable/bin/Release/publish/
$ cat $DEPLOYFILE > Properties/sshDeploy.json
$ cat $KEYFILE > Properties/sshDeploy.key
$ dotnet ssh-deploy production
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
  - The following frameworks were found:
      5.0.1 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=debian.10-x64

Cleaning up file based variables

ERROR: Job failed: exit code 1
@ygoe
Copy link
Owner

ygoe commented Dec 20, 2020

Just a quick look, it's probably not .NET 5 causing the issue but the absence of .NET Core 2.0 (EOL now). Since you only have .NET 5 installed (not even 3.1), this tool would need to target .NET 5 specifically. I should probably upgrade this to 3.1 (LTS) and you could install that as well. Let's see if I can target both 3.1 and 5.0.

Time to finally take some time and improve this tool, it seems. :-)

@ygoe ygoe closed this as completed in ac283db Mar 1, 2021
@ygoe ygoe reopened this Mar 5, 2021
@ygoe
Copy link
Owner

ygoe commented Mar 5, 2021

Looks like dotnet CLI tools only support .NET Core 2.2 or lower. It's nothing I can change now. Please refer to the linked issue. The latest version of this tool might thus be impossible to use.

Workaround: Use the previous version 0.3.2 of DotnetSshDeploy and install the .NET Core 2.1 runtime.

@ygoe
Copy link
Owner

ygoe commented Mar 9, 2021

Should be fixed now. Please use the latest release 0.4.1 and follow the new instructions for .NET tools in the README file.

Note that the .NET 5.0 runtime is now required. Older .NET Core runtimes are no longer compatible with this latest release. Version 0.3.2 is functionally identical for now but newer development will be based on .NET 5.0.

@ygoe ygoe closed this as completed Mar 9, 2021
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

2 participants