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
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
The text was updated successfully, but these errors were encountered:
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.
Description
If the test project is targeting .NET Framework version 4.8.1 or lower, long paths can not be used in tests.
Currently, this can be worked around by prepending
\\?\
to every long path or by making paths shorter.This problem may be solved by making test runners long path aware by adding the necessary elements to the
testhost
manifest:Steps to reproduce
Clone the sample solution https://github.com/DragonTea135/vstest-long-path-sample.
Run tests using Visual Studio,
dotnet test
orvstest.console
.Expected behavior
All tests should pass in both
net481
andnet8
projects.Actual behavior
Test that creates a directory with a long path in the
net481
project throws an exception:Lower target framework versions give the same result.
Environment
Windows 11 version 23H2
Visual Studio version 17.11.0
VSTest version 17.11.0
The text was updated successfully, but these errors were encountered: