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

[ISSUE]: netstandard2.0 Support in 6.0.0 #4075

Closed
2 tasks done
KiLLeRRaT opened this issue Jun 24, 2024 · 1 comment
Closed
2 tasks done

[ISSUE]: netstandard2.0 Support in 6.0.0 #4075

KiLLeRRaT opened this issue Jun 24, 2024 · 1 comment

Comments

@KiLLeRRaT
Copy link
Contributor

KiLLeRRaT commented Jun 24, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.MsBuild

GitVersion version

6.0.0-rc.1

Operating system

Linux

What are you seeing?

After upgrading from 6.0.0-beta.3, My netstandard2.0 project doesn't work with GitVersion.MsBuild anymore. When doing a dotnet build I just get an error:

Build FAILED.

/home/albert/.nuget/packages/gitversion.msbuild/6.0.0-rc.1/tools/GitVersion.MsBuild.targets(21,9): error MSB3073: The command "dotnet --roll-forward Major "/home/albert/.nuget/packages/gitversion.msbuild/6.0.0-rc.1/tools/netstandard2.0/gitversion.dll" "/home/albert/source/SAL.Sandfield.Database.Migrator/src/Sandfield.Database.Migrator"  -output file -outputfile "obj/gitversion.json"" exited with code 1. [/home/albert/source/SAL.Sandfield.Database.Migrator/src/Sandfield.Database.Migrator/Sandfield.Database.Migrator.csproj]
    0 Warning(s)
    1 Error(s)

Running the command standalone, I see it's looking for gitversion.dll in a netstandard2.0 directory but doesn't exist:

❯ dotnet --roll-forward Major "/home/albert/.nuget/packages/gitversion.msbuild/6.0.0-rc.1/tools/netstandard2.0/gitversion.dll" "/home/albert/source/SAL.Sandfield.Database.Migrator/src/Sandfield.Database.Migrator"  -output file -outputfile "obj/gitversion.json"
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet---roll-forward does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

My ~/.nuget/packages/gitversion.msbuild/6.0.0-rc.1/tools directory:

6.0.0-rc.1/tools:
total 24K
drwxr-xr-x 1 albert albert  136 Jun 24 12:09 ./
drwxr-xr-x 1 albert albert  370 Jun 24 12:09 ../
-rwxr--r-- 1 albert albert 6.6K May 23 21:43 GitVersion.MsBuild.props*
-rwxr--r-- 1 albert albert  13K May 23 21:43 GitVersion.MsBuild.targets*
drwxr-xr-x 1 albert albert 3.4K Jun 24 12:09 net6.0/
drwxr-xr-x 1 albert albert 3.4K Jun 24 12:09 net7.0/
drwxr-xr-x 1 albert albert 3.1K Jun 24 12:09 net8.0/

My dotnet tools situation:

❯ dotnet --list-sdks
6.0.131 [/usr/share/dotnet/sdk]
8.0.106 [/usr/share/dotnet/sdk]
❯ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.31 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.31 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
❯ dotnet tool list -g
Package Id                       Version         Commands
------------------------------------------------------------------
cyclonedx                        3.0.8           dotnet-CycloneDX
dotnet-ef                        8.0.0           dotnet-ef
dotnet-repl                      0.1.208         dotnet-repl
erikej.efcorepowertools.cli      8.1.148         efcpt
fluentmigrator.dotnet.cli        5.0.0           dotnet-fm
gitversion.tool                  6.0.0-rc.1      dotnet-gitversion

Thanks,

What is expected?

Should continue working.

Steps to Reproduce

Create a brand new netstandard2.0 Class Lib and install GitVersion.MsBuild 6.0.0-rc.1

dotnet new classlib --name GitVersion-RCTest -f netstandard2.0
cd GitVersion-RCTest
git init
git add .
git commit -m "Init"
dotnet build # WORKS
dotnet add package GitVersion.MsBuild --version 6.0.0-rc.1
dotnet build # FAILS

And doing this with 6.0.0-beta.3 works:

dotnet new classlib --name GitVersion-RCTest -f netstandard2.0
cd GitVersion-RCTest
git init
git add .
git commit -m "Init"
dotnet build # WORKS
dotnet add package GitVersion.MsBuild --version 6.0.0-beta.3
dotnet build # WORKS

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

@arturcic
Copy link
Member

This was changed in beta.4. The reason for the change was the size of the resulting nuget package was too big.
Taking in consideration, and that targeting the netstandard2.0 is not recommended anymore, and also because we removed support for the .Net Framework, we decided to target only .net6 - .net8 and later to target LTS and STS version.

@arturcic arturcic closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants