dotnet / dotnet/project-system
The system cannot find the path specified When Attempting to Add to a Non-Existent Folder
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
**Visual Studio Version**:
Visual Studio 2019 Enterprise 16.6.2
**Summary**:
In Visual Studio 2019 Enterprise as of 16.2.2 it is possible to get a CSPROJ File in a state where you cannot add files into it via Visual Studio.
The root cause of the problem is that the CSPROJ File has this directive:
```xml
```
However in the working copy this folder does not exist.
**Steps to Reproduce**:
1. Clone the Following Repository https://github.com/aolszowka/VisualStudioNonExistentFolderError
2. Attempt to add a new item into the NonExistentFolder
**Expected Behavior**:
In these cases its probably just best to create the folder that is referenced in the project file.
**Actual Behavior**:
Visual Studio Throws:
```text
---------------------------
Microsoft Visual Studio
---------------------------
The system cannot find the path specified.
---------------------------
OK
---------------------------
```
**User Impact**:
This causes a bunch of user confusion.
I suspect but cannot prove this is probably the root cause of these peoples issues:
1. https://developercommunity.visualstudio.com/content/problem/754545/error-box-stating-that-the-system-cannot-find-the.html
1.1 In this case someone at Microsoft (Vijay Ramakrishnan @vijayrkn ) figured it out, but didn't link a bug report.
2. https://developercommunity.visualstudio.com/content/problem/833438/solution-explorer-add-class-the-system-cannot-find.html
Does not look too uncommon.
Contributor guide
Assessment
This issue has not been assessed yet.