Skip to content

.NET 6.0.101 breaks GENERIC_MATH_FEATURE/PreviewFeatures functionallity #62840

Closed

Description

@samtrion

Description

After updating to the latest Visual Studio 2022 version on 12/14/21 and .NET SDK version 6.0.101, the project could not be built. Since the interfaces IBinaryNumber, IComparisonOperators & IFloatingPoint could no longer be found in the project https://github.com/samtrion/netevolve-guard

Reproduction Steps

  • Trying to build project with .NET 6.0.101

Expected behavior

Project can continue to be built successfully.

Actual behavior

Project can no longer be created because the interfaces IBinaryNumber, IComparisonOperators & IFloatingPoint are not available.

Regression?

Yes, with the mentioned workaround the creation of the project works.

Known Workarounds

Disabled the rollForward via the global.json.

{
  "sdk": {
    "version": "6.0.100",
    "rollForward": "disable"
  }
}

Configuration

  • Which version of .NET is the code running on?
    So far always the latest SDK version of .NET 6
  • What OS and version, and what distro if applicable?
    Windows 10 & Windows 11
  • What is the architecture (x64, x86, ARM, ARM64)?
    x64
  • Do you know whether it is specific to that configuration?
    Was able to recreate the issue both locally and on the GitHub Actions Runner.

Other information

No response

Activity

  1. ghost added
    untriaged
    on Dec 15, 2021
  2. danmoseley commented on Dec 15, 2021

    @danmoseley
    Contributor
  3. Chamberlain91 commented on Dec 16, 2021

    @Chamberlain91

    I have also suffered this error in my hobby project. I'm unsure how to install 6.0.100 again. The SDK installer complains I have another version of the project and adding that global.json gives me:

    Could not execute because the application was not found or a compatible .NET SDK is not installed.
    Possible reasons for this include:
      * You intended to execute a .NET program:
          The application 'build' does not exist.
      * You intended to execute a .NET SDK command:
          A compatible installed .NET SDK for global.json version [6.0.100] from [C:\Users\<my_user_project_path>\global.json] was not found.
          Install the [6.0.100] .NET SDK or update [C:\Users\<my_user_project_path>\global.json] with an installed .NET SDK:
            2.1.701 [C:\Program Files\dotnet\sdk]
            2.1.801 [C:\Program Files\dotnet\sdk]
            2.1.802 [C:\Program Files\dotnet\sdk]
            3.0.100-preview9-014004 [C:\Program Files\dotnet\sdk]
            5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]
            6.0.101 [C:\Program Files\dotnet\sdk]
    
  4. samtrion commented on Dec 16, 2021

    @samtrion
    Author

    I have also suffered this error in my hobby project. I'm unsure how to install 6.0.100 again. The SDK installer complains I have another version of the project and adding that global.json gives me:

    Could not execute because the application was not found or a compatible .NET SDK is not installed.
    Possible reasons for this include:
      * You intended to execute a .NET program:
          The application 'build' does not exist.
      * You intended to execute a .NET SDK command:
          A compatible installed .NET SDK for global.json version [6.0.100] from [C:\Users\<my_user_project_path>\global.json] was not found.
          Install the [6.0.100] .NET SDK or update [C:\Users\<my_user_project_path>\global.json] with an installed .NET SDK:
            2.1.701 [C:\Program Files\dotnet\sdk]
            2.1.801 [C:\Program Files\dotnet\sdk]
            2.1.802 [C:\Program Files\dotnet\sdk]
            3.0.100-preview9-014004 [C:\Program Files\dotnet\sdk]
            5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]
            6.0.101 [C:\Program Files\dotnet\sdk]
    

    You can find the download here - https://dotnet.microsoft.com/en-us/download/dotnet/6.0#version_1

  5. martincostello commented on Dec 16, 2021

    @martincostello
    Member

    I also logged this in the SDK repo: dotnet/sdk#23073

  6. danmoseley commented on Dec 16, 2021

    @danmoseley
    Contributor

    cc @safern in case he's around tomorrow and has insights. We shouldn't have broken this...

  7. safern commented on Dec 16, 2021

    @safern
    Member

    Since we serviced the ref pack we might have broken it because of file versions so with 6.0.1 assembly conflict resolution might prefer the System.Runtime in the ref pack rather than the one in the System.Runtime.Experimental package.

    Looking to confirm this theory and see what we can do for next servicing releases.

  8. safern commented on Dec 17, 2021

    @safern
    Member

    I was able to confirm that theory with the repository shared on the issue, this is the output from the conflict resolution:

    Encountered conflict between 'Reference:C:\Users\safern\.nuget\packages\system.runtime.experimental\6.0.0\ref\net6.0\System.Runtime.dll' and 'Reference:C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.1\ref/net6.0/System.Runtime.dll'. Choosing 'Reference:C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.1\ref/net6.0/System.Runtime.dll' because file version '6.0.121.56705' is greater than '6.0.121.52210'.
    

    You can workaround this if you want to use 6.0.101 SDK by adding this target to the projects that want to use System.Runtime.Experimental (in the case of netevolve-guard, your .Experimental and .Experimental.Tests projects) you can add it in a common location like a Directory.Build.targets file:

      <Target Name="RemoveSystemRuntimeFromRefPack"
              BeforeTargets="_HandlePackageFileConflicts"
              Condition="'@(Reference -> WithMetadataValue('NugetPackageId', 'System.Runtime.Experimental'))' != ''">
        <ItemGroup>
          <Reference Remove="@(Reference)"
                     Condition="$([System.String]::Copy(%(Reference.Identity)).Contains('System.Runtime.dll')) and
                                '%(Reference.NuGetPackageId)' == 'Microsoft.NETCore.App.Ref'" />
        </ItemGroup>
      </Target>

    @ericstj @dsplaisted is there a way to tell package conflict file resolution to always choose the asset from System.Runtime.Experimental via a platform manifest or package override file in the ref pack? Or do we have to service System.Runtime.Experimental every time we service the ref pack?

  9. added this to the 6.0.x milestone on Dec 17, 2021
  10. ericstj commented on Dec 17, 2021

    @ericstj
    Member

    We intentionally tried to address this here: https://github.com/dotnet/runtime/pull/55678/files#diff-41acba6267202db943fa29d434bb231021a7b8b47b63c990bd61708111c67515R33

    I can't see where we're addressing conflict resolution in the current approach, did that get removed?

  11. ericstj commented on Dec 17, 2021

    @ericstj
    Member

    Rereading above, it looks like folks didn't understand how ref-pack servicing / file-versions worked when we did it initially.

    6.0.121.56705' is greater than '6.0.121.52210'

    I think we should just modify how much gap we bump the experimental reference assembly to make sure it will be higher than servicing.

  12. safern commented on Dec 17, 2021

    @safern
    Member

    Should we just set the minor version of the file version for System.Runtime.Experimental so that we guarantee it is always greater?

  13. tannergooding commented on Jan 3, 2022

    @tannergooding
    Member

    Should we just set the minor version of the file version for System.Runtime.Experimental so that we guarantee it is always greater?

    I don't think there is a particular preference provided we know we won't need to publish some actual v6.1 version of the things at any point.

  14. ericstj commented on Jan 3, 2022

    @ericstj
    Member

    I think bumping the minor version of only the file version should be fine. Fix should go here:

    <FileVersion>$(_FileVersionMaj).$(_FileVersionMin).$([MSBuild]::Add($(_FileVersionBld), 100)).$(_FileVersionRev)</FileVersion>

    And we should be able to remove the incrementing of _FileVersionBld

  15. safern commented on Jan 3, 2022

    @safern
    Member

    Let me know if help is needed to drive fixing this and porting it. We have till Monday to make the cut for 6.0.2

  16. tannergooding commented on Jan 3, 2022

    @tannergooding
    Member

    Do I just need to put up a PR against main or do I need to also target some existing servicing branch?

  17. tannergooding commented on Jan 3, 2022

    @tannergooding
    Member

    Likewise, is the minor version differing going to cause problems with version resolution or if we do end up exposing an actual v6.1 in the future?

  18. safern commented on Jan 3, 2022

    @safern
    Member

    Do I just need to put up a PR against main or do I need to also target some existing servicing branch?

    We need to put it against main and against release/6.0 and then go over through servicing approval.

    Likewise, is the minor version differing going to cause problems with version resolution or if we do end up exposing an actual v6.1 in the future?

    It shouldn't be a problem. If needed we can always bump the minor version for the file version attribute on v6.1 to something like 6.200.x

  19. ghost added
    in-pr
    on Jan 8, 2022
  20. ghost removed
    in-pr
    on Jan 10, 2022
  21. ghost added
    in-pr
    on Jan 10, 2022
  22. ghost removed
    in-pr
    on Jan 11, 2022
  23. ghost locked as resolved and limited conversation to collaborators on Feb 10, 2022
  24. removed
    untriaged
    on Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions