Prepending “\\?\” doesn't work for handling long paths

后端 未结 1 464
别跟我提以往
别跟我提以往 2021-01-14 04:04

I\'m trying to find a workaround for the Windows character limitation that doesn\'t allow a file to be copied if its name is >= 260 characters. According to this MSDN artic

相关标签:
1条回答
  • 2021-01-14 04:49

    To enable long path support you either need to be targetting .Net Framework 4.6.2 (or newer) or you need to tell your app that it can support long filenames. To do that, add this to your app.config:

    <runtime>
      <AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
    </runtime>
    

    Further reading can be done here.

    0 讨论(0)
提交回复
热议问题