12

I'm trying to follow Microsoft documentation to lift MAX_PATH file path restriction in APIs under Windows 10. It says:

You can also enable the new long path behavior per app via the manifest:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>

So, first question. Is it possible to enable it in project properties in Visual Studio 2017?

Second question: I failed to find an answer above, so I decided to go a manual route:

  1. I created the additional.manifest text file as such:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
            <ws2:longPathAware>true</ws2:longPathAware>
        </windowsSettings>
    </application>
    </assembly>
    
  2. I then added it to the project properties:

enter image description here

  1. But then when I compile it, it gives me this warning, and that manifest seems to have no effect when the application runs:

1>additional.manifest : manifest authoring warning 81010002: Unrecognized Element "longPathAware" in namespace "http://schemas.microsoft.com/SMI/2016/WindowsSettings".

So what am I doing wrong?

c00000fd
  • 20,994
  • 29
  • 177
  • 400
  • 1
    Annoyingly, but not atypically, the schema isn't available at that URI any more so we can't even check. Thanks, Microsoft. – Lightness Races in Orbit Dec 25 '18 at 00:00
  • @LightnessRacesinOrbit: I'm not sure what to think.... did they document it but forgot to implement it? – c00000fd Dec 25 '18 at 00:03
  • @LightnessRacesinOrbit: wow, that's some advanced knowledge of SO. I didn't know it supported emojis. – c00000fd Dec 25 '18 at 00:23
  • It doesn't, specifically; emoji are just more Unicode characters like "a" or "!" or "⺐". If your font has glyphs for them, you'll see them. You can generate emoji using phone on-screen keypads, or various keyboard shortcuts on desktop OSs (e.g. Win+dot on Win10) – Lightness Races in Orbit Dec 25 '18 at 00:27
  • 1
    @LightnessRacesinOrbit: Hey, thanks. That's very cool. ‍ I learned something today (And now I need to stop spamming SO with my newly acquired knowledge.) – c00000fd Dec 25 '18 at 00:32
  • 3
    Clearly I have created a monster – Lightness Races in Orbit Dec 25 '18 at 00:34
  • @LightnessRacesinOrbit namespaces aren’t schemas…. Think of a namespace as a java package name (which often looks like a DNS domain name written backwards but is not meant to be used as an instruction to navigate to that domain). The reason one puts a domain name in there is to avoid namespace collisions. – binki Jun 06 '22 at 20:54

1 Answers1

2

No. There is no switch in the Visual Studio 2017 v15.9.4 project properties for Windows Desktop or Console Applications to enable "Long Path Aware".

The Microsoft Documentation that you linked above says following:

Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior.

Make sure you target a Windows SDK for Windows 10, version 1607 or above for your used configuration and a current toolset. You need at least Windows SDK v10.0.14393.795. Current version is v10.0.17763.0.

You can find and change the targeted Windows SDK version and the targeted toolset in the "General" property sheet of the project's properties.

Side note: Make overall configuration changes active in all configurations. Change the property sheet's configuration options to "All configurations" and "All Platforms" except you make a change specifically for a platform.

FA85
  • 45
  • 5