Repository navigation
Description
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
- On Windows, clone
https://github.com/Esri/arcgis-toolkit-dotnetintoC:\github\esri\arcgis-toolkit-dotnet\ - Upgrade the project
src\Toolkit\Toolkit.Maui\Esri.ArcGISRuntime.Toolkit.Maui.csprojto .NET 10. - 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.
Activity
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)
Shorten BindingSourceGen hint names (#35986)