You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET Framework test runners are not long path awareΒ #5179
Run tests using Visual Studio, dotnet test or vstest.console.
Expected behavior
All tests should pass in both net481 and net8 projects.
Actual behavior
Test that creates a directory with a long path in the net481 project throws an exception:
System.IO.PathTooLongException : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Lower target framework versions give the same result.
Environment
Windows 11 version 23H2
Visual Studio version 17.11.0
VSTest version 17.11.0
Thank you for the suggestion, we are currently not adding new features to vstest. I've marked this as up for grabs, in case you or someone else wants to implement the change.
The longPathAware setting was added to the real vstest.console.exe and testhost.exe under Extensions\TestPlatform, but the backwards-compat wrapper at CommonExtensions\Microsoft\TestWindow\vstest.console.exe is still missing it.
This wrapper is the binary on the Developer Command Prompt PATH (see where vstest.console.exe). It's a .NET Framework shim (RockSteady.Program) that delegates to the real binary via AppDomain.ExecuteAssembly. Since it's the process the OS sees, its manifest controls longPathAware behavior for any path resolution that happens before handoff.
Same gap as the maxversiontested issue in #5041 β the wrapper is owned by VS Test Explorer (internal), not the vstest repo.
This is really a problem with the VS owned helper. I filed this feedback item
Activity
nohwnd commentedon Aug 19, 2024
Thank you for the suggestion, we are currently not adding new features to vstest. I've marked this as up for grabs, in case you or someone else wants to implement the change.
Make test runners long-path aware (microsoft#5179)
Make test runners long-path aware (#5179) (#15014)
ChrisGuzak commentedon Mar 13, 2026
The
longPathAwaresetting was added to the realvstest.console.exeandtesthost.exeunderExtensions\TestPlatform, but the backwards-compat wrapper atCommonExtensions\Microsoft\TestWindow\vstest.console.exeis still missing it.This wrapper is the binary on the Developer Command Prompt PATH (see
where vstest.console.exe). It's a .NET Framework shim (RockSteady.Program) that delegates to the real binary viaAppDomain.ExecuteAssembly. Since it's the process the OS sees, its manifest controlslongPathAwarebehavior for any path resolution that happens before handoff.Same gap as the
maxversiontestedissue in #5041 β the wrapper is owned by VS Test Explorer (internal), not the vstest repo.This is really a problem with the VS owned helper. I filed this feedback item
chore(deps): update dependency microsoft.net.test.sdk to v18 (#35)
chore(deps): update dependency microsoft.net.test.sdk to 17.14.1 (#22)
chore(deps): update dependency microsoft.net.test.sdk to v18 (#16)