Skip to content

Binding generators easily exceeds MAX_PATH on Windows #35857

Closed

Description

@dotMorten

Description

When I upgraded from .NET 9 to .NET 10 I suddenly can't build. What I'm finding is that the Binding Source Generator is creating insanely long file paths, exceeding Windows' MAX_PATH limitation.

This is a showstopper for us supporting .NET 10.

Example path:
E:\GitHub\Esri\arcgis-toolkit-dotnet\src\Toolkit\Toolkit.Maui\obj\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\E--GitHub-Esri-arcgis-toolkit-dotnet-src-Toolkit-Toolkit-UI-Controls-OfflineMapAreas-OfflineMapAreasView.Maui.cs-GeneratedBindingInterceptors-104-35.g.cs

Note how Microsoft.Maui.Controls.BindingSourceGen is there twice in the path, and in the file-name itself is included the full raw path to the original file with -GeneratedBindingInterceptors-104-35.g appended to it.

This filename appears to be coming from here:

var fileName = $"{location.FilePath}-GeneratedBindingInterceptors-{location.Line}-{location.Column}.g.cs";

Introduced in #27145 by @jkurdek

It would be better if it generated:
E:\GitHub\Esri\arcgis-toolkit-dotnet\src\Toolkit\Toolkit.Maui\obj\Debug\net10.0\BindingSourceGenerator\Toolkit-UI-Controls-OfflineMapAreasView.Maui.cs-104-35.g.cs (ie remove duplicated folder, use relative paths and remove -GeneratedBindingInterceptors since it's already in a folder for the generator).
An alternative would be to use hash of the directory, so it would just be E:\GitHub\Esri\arcgis-toolkit-dotnet\src\Toolkit\Toolkit.Maui\obj\Debug\net10.0\BindingSourceGenerator\[FOLDER_HASH]\OfflineMapAreasView.Maui.cs-104-35.g.cs

Steps to Reproduce

  1. On Windows, clone https://github.com/Esri/arcgis-toolkit-dotnet into C:\github\esri\arcgis-toolkit-dotnet\
  2. Upgrade the project src\Toolkit\Toolkit.Maui\Esri.ArcGISRuntime.Toolkit.Maui.csproj to .NET 10.
  3. Compile Esri.ArcGISRuntime.Toolkit.Maui.csproj

Link to public reproduction project repository

https://github.com/Esri/arcgis-toolkit-dotnet

Version with bug

10.0.40

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.120 SR12

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No. Even if I clone into a 1 character long path, I still get a path length of 287.

Relevant log output

Activity

  1. added a commit that references this issue on Jul 14, 2026
    5296a64
  2. added this to the .NET 10 SR10 milestone on Jul 14, 2026
  3. added a commit that references this issue on Jul 15, 2026
    05803fe
  4. added 3 commits that reference this issue on Jul 22, 2026
    76e6e57
    a11f87d
    de7f5e5
  5. added 2 commits that reference this issue on Aug 7, 2026
    92b0dea
    adecf03
  6. added 12 commits that reference this issue on Aug 27, 2026
    9f4bb82
    16b6693
    1da86a8
    68cd518
    d9f75ed
    5371e29
    63f816e
    b6ea513
    cd1fc33
    2c94c5a
    5a54734
    aa5b2ba
  7. locked and limited conversation to collaborators on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions