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

error C3611: 'System::Numerics::INumberBase::System::IUtf8SpanFormattable.TryFormat': a sealed function cannot have a pure-specifier #8944

Closed
2 of 10 tasks
NaveenVNaik opened this issue Dec 4, 2023 · 4 comments

Comments

@NaveenVNaik
Copy link

NaveenVNaik commented Dec 4, 2023

Description

I am getting this error while building the c++/cli project in Azure Pipeline.

Error I am getting: error C3611: 'System::Numerics::INumberBase::System::IUtf8SpanFormattable.TryFormat': a sealed function cannot have a pure-specifier

Task: VSBuild@1
UseDotNet@2 (version): 8.0.x
vmImage: 'windows-2022'

I have gone through the existing defect dotnet/runtime#94998. Here the solution states that we have to use v14.38 or higher and so VS2022 17.8 or later. As I am using Microsoft hosted agent machine (windows-2022), all the required tools are installed, but still it is failing to build the project.

Could someone please help me to resolve this issue.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

vmImage: 'windows-2022'

Is it regression?

No

Expected behavior

Project should build without any errors.

Actual behavior

Build is failing with error C3611: 'System::Numerics::INumberBase::System::IUtf8SpanFormattable.TryFormat': a sealed function cannot have a pure-specifier

Repro steps

In Azure pipeline, use windows-2022 image and .NET 8.0.x to build the c++/cli project.

Few task details:

pool:
vmImage: 'windows-2022'

- task: UseDotNet@2
  displayName: Use .NET8 SDK
  inputs:
    packageType: 'sdk'
    version: '8.0.x'

- task: VSBuild@1
  displayName: 'Build to get all Test Binaries'
  inputs:
    solution: '$(solution)'
    vsVersion: 'latest'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'
    msbuildArgs: '-p:OutputPath=$(System.DefaultWorkingDirectory)\bin\$(buildPlatform)\$(buildConfiguration)'
    clean: true
    maximumCpuCount: true
@ilia-shipitsin
Copy link
Contributor

Hello @NaveenVNaik , do you have repro steps, maybe some minimal project publicly available ?

@NaveenVNaik
Copy link
Author

Hi @ilia-shipitsin , I cannot share the code as it is in my companies private repo.

@ilia-shipitsin
Copy link
Contributor

ilia-shipitsin commented Dec 4, 2023

Hello, @NaveenVNaik

In the issue mentioned by you is said that VC toolset 14.38 is required.
That toolset is included into current windows images.

As there're several toolsets included, VSbuild@1 task may pick either of them. For more diagnostic, please add '-bl' flag to msbuildArgs, it will produce binary log (file msbuild.binlog).

Can you please collect msbuild.binlog via following task

- task: PublishBuildArtifacts@1
  condition: always()
  inputs:
    PathtoPublish: '$(Pipeline.Workspace)\msbuild.binlog'
    ArtifactName: 'msbuild.binlog'
    publishLocation: 'pipeline'

@NaveenVNaik
Copy link
Author

NaveenVNaik commented Dec 4, 2023

Hello @ilia-shipitsin,

The issue is resolved. We have to set the MSVC toolset version to 14.38 in C++/CLI project properties.
[ Configuration Properties -> Advanced -> MSVC Toolset version -> 14.38 ]

image

There is no issue with windows current image.

Thank you for looking into it. !

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