I have multiple solutions that we changed to use deep folder structures / long file names. Some are failing to build due to long paths (exceeding 260 characters).
I have updated group policy / registry as indicated here and dozens of other places.
I can build using a command line dotnet build
command, but building in Visual Studio (2022) fails, indicating it can't find a build-generated file. That error boils down to the path that the build would've written output / intermediate files to was too long so it didn't create the file later steps expect.
I know there are workarounds like redirecting working build folders, but am looking for how to allow Visual Studio to build as it does by default regardless of folder name length.
I can build using a command line dotnet build command, but building in Visual Studio (2022) fails, indicating it can't find a build-generated file. That error boils down to the path that the build would've written output / intermediate files to was too long so it didn't create the file later steps expect.
I know there are workarounds like redirecting working build folders, but am looking for how to allow Visual Studio to build as it does by default regardless of folder name length.
The answer is NO.
You mentioned dotnet build is ok, that is because compiler issue fixed at 2019:
https://github.com/dotnet/roslyn/issues/32804
In that annonucement, you can see the official mentioned the feedback ticket about VS Tool:
https://developercommunity.visualstudio.com/t/allow-building-running-and-debugging-a-net-applica/351628
The devenv.exe.config doesn't opt into the long path support yet, so VS Tool doesn't support the feature.
So it is impossible currently to "allow Visual Studio to build as it does by default regardless of folder name length."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With