Skip to content

dotnet-format verify-no-changes throw error for AOT app API #50012

@WeihanLi

Description

@WeihanLi

Describe the bug

I'm using dotnet format --verify-no-changes to verify the code style. When I use it with an AOT WebApi, it throws an error about the MapGet usage

Image

while it succeeds in publishing.

Image

To Reproduce

It could be reproduced with an empty webapi aot project

Steps to reproduce

dotnet new webapiaot -n AotApi

cd ./AotApi

dotnet format --verify-no-changes

Exceptions (if any)

Error throws

Image

Further technical details

.NET SDK:
 Version:           10.0.100-preview.6.25358.103
 Commit:            75972a5ba7
 Workload version:  10.0.100-manifests.b6c7f53e
 MSBuild version:   17.15.0-preview-25358-103+75972a5ba

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.5
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/10.0.100-preview.6.25358.103/

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.

Host:
  Version:      10.0.0-preview.6.25358.103
  Architecture: arm64
  Commit:       75972a5ba7

.NET SDKs installed:
  8.0.405 [/usr/local/share/dotnet/sdk]
  9.0.200 [/usr/local/share/dotnet/sdk]
  10.0.100-preview.6.25358.103 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.0-preview.6.25358.103 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.1.25080.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.2.25163.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.3.25171.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.4.25258.110 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.5.25277.114 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-preview.6.25358.103 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Also reproducing on .NET 9: https://github.com/open-feature/dotnet-sdk/actions/runs/16647786459/job/47112517737?pr=537

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions