Test Console fails if path contains forward slash
See original GitHub issueDescription
When using the latest SDK, you get an error if your VSTestResultsDirectory
contains a forward slash (on Windows).
Microsoft (R) Test Execution Command Line Tool Version 16.3.0-preview-20190808-04
Copyright (c) Microsoft Corporation. All rights reserved.
The path 'C:\Users\tagoo\repos\clangsharp\artifacts/tst/Debug/' specified in the 'ResultsDirectory' is invalid. Error: Illegal characters in path.
Steps to reproduce
- Clone https://github.com/microsoft/clangsharp
- Run .\scripts\cibuild.cmd
Expected behavior
Everything succeeds (as with previous versions)
Actual behavior
The Test Execution Command Line Tool fails with the above diagnostics.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Difference between forward slash (/) and backslash (\) in ...
I was wondering about the difference between \ and / in file paths. I have noticed that sometimes a path contains / and...
Read more >paths containing forward slashes are rejected on Win32
If the document is interpretable as saying that forward slash should work wherever backwardslash works, then I believe the document is wrong, and...
Read more >Is it good practice to require a trailing forward slash in ...
I want to ask the user of my bash script to pass a directory path as argument. Which one of the following is...
Read more >Forward slashes break map addDataFromPath method i...
In ArcGIS Pro 2.4.0, I noticed some unexpected behavior with forward slashes in data paths with code run in the Python console embedded...
Read more >File path formats on Windows systems
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As a fundamental design principle, don’t try and validate paths. You’ll inevitably get it wrong. Let
Path.GetFullPath()
normalize it for you (which it does through the OS) and let the OS tell you if the path isn’t usable when you try to use it.Note that even if you do validate a path, there is no way to ensure that the path will be the same next time you access it. Files turn into directories and vice versa, paths get deleted, etc.
@eerhardt Yes the issue should be closed. We have made a release as well with this fix. The fix will go into dotnet cli 3.0 also.