카테고리 없음

c# 긴폴더

yoon-record 2023. 10. 22. 16:58

0. 윈도우10 1067 이상버전, 닷넷프레임워크 4.6.2 이상

 

1.윈도우우클릭 실행 gpedit.msc

컴퓨터구성 > 관리템플릿 > 시스템 > 파일시스템 > Win32 긴 경로 사용 설정 및 적용 // 재부팅 불필요

 

2.App.config

  <runtime> 항목에 아래 추가
  <AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />

 

3.프로젝트 > 새항목 > 애플리케이션 매니패스트 추가

app.manifest 아래구문 주석 해제 또는 추가

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

 

참고문서)

https://social.technet.microsoft.com/wiki/contents/articles/12179.net-troubleshooting-path-too-long-exception-and-net-powershell-robocopy-clone.aspx

 

.NET Troubleshooting: Path too Long Exception and .NET PowerShell Robocopy Clone - TechNet Articles - United States (English) -

 

social.technet.microsoft.com

https://learn.microsoft.com/ko-kr/archive/blogs/jeremykuhne/net-4-6-2-and-long-paths-on-windows-10

 

.NET 4.6.2 and long paths on Windows 10

Table of contents .NET 4.6.2 and long paths on Windows 10 Article 07/30/2016 In this article --> The Windows 10 Anniversary update is almost out the door. .NET 4.6.2 is in the update (as we've looked at in the past few posts). I've talked a bit about what

learn.microsoft.com

 

기타) 아래 라이브러리 사용 (확인은 안해봄)

https://alphafs.alphaleonis.com/