-
Notifications
You must be signed in to change notification settings - Fork 391
Add longPathAware declaration to app.manifest for C# project templates #5830
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
base: main
Are you sure you want to change the base?
Conversation
This is a dangerous default Developers won't specifically be testing their apps with long paths if it's the default, so they'll think everything is fine, and then one native library they may be indirectly using does Long paths are something that should only be enabled after full validation that your app works as expected with them. |
Maybe a milder version of this PR would be to set this explicitly to false with a comment? What are the opinions on that? <!-- Set to true to allow paths longer than 260 characters. May cause issues with some third-party components. -->
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">false</longPathAware> |
I would be fine with that, but just comment it out instead of an explicit false. <!-- Uncomment to allow paths longer than 260 characters. May cause issues with some third-party components. -->
<!-- <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> --> |
Note: This change does nothing until this feature is turned on machine-wide. This is off by default. ( I agree with others here, however. This change may confuse newcomers with crashes/undefined behavior after bringing in libraries that don't properly support long paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App compat impact here is too great
EDIT: I dont believe any APIs( It has become a chicken and egg problem at this point.
This is the way to go forward. |
Including this feature upfront could create lots of confusion for developers who might expect it to work out of the box. (It won't work out of the box.) Developers with specialized use cases who genuinely need this functionality can figure this out through documentation or by consulting with subject matter experts. |
Since Windows 10 1607, developers can declare a flag in their app.manifest to remove the MAX_PATH limitation. This enables support for file paths longer than 260 characters.
Modern versions of .NET support this well and most .NET libraries also support this as well due to their cross-platform design. Other platforms do not impose the same limitation.
For new C# applications in 2025 and beyond, the recommended default value for longPathAware should be true. This PR enables that setting in the C# project templates.
This change does not force WinAppSDK apps to be longPathAware. If incompatibilities arise, developers can remove the line, or set the value to false explicitly.
I have not updated the C++ templates in this PR.
A microsoft employee must use /azp run to validate using the pipelines below.
WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.
For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.