question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test Console fails if path contains forward slash

See original GitHub issue

Description

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

  1. Clone https://github.com/microsoft/clangsharp
  2. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
JeremyKuhnecommented, Aug 12, 2019

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.

1reaction
vagisha-nidhicommented, Aug 29, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found