dotnet / dotnet/project-system
Make project file editor work consistently when a CPS project has failed to load, or is unloaded
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
_This issue has a corresponding [ticket on Developer Community](https://developercommunity.visualstudio.com/content/idea/808385/stop-closing-sdk-style-csproj-open-as-document-whe.html). Please vote and comment there to make sure your voice is heard._
---
It's questionable if one could call it a "feature" to have VS _not_ close a document when simply (re-)loading a project in an existing Solution, but whatever. Here's a feature request for VS to stop wasting our time.
repro:
- Create an SDK-style .csproj
- Add it as a project to VS
- Unload Project from Solution Explorer
- Edit (the project file) from Solution Explorer
- Reload Project from Solution Explorer
Expected: Project gets loaded, while the text view of the .csproj continues to display. No questions asked (except possibly if you want to first save changes to it, in case it's "dirty").
Actual:
You are presented with a dialog
```
---------------------------
Microsoft Visual Studio
---------------------------
The document 'blahblahblah.csproj' is already open. Do you want to close it?
---------------------------
Yes No
---------------------------
```
As you want to continue to view (or edit) the .csproj, you obviously select "No". Result? VS silently refuse to load the project!
Workaround:
Answer "Yes" in that dialog, select Edit Project File from Solution Explorer. This is only to get back to (rougly) the state you already were in, and wanted to remain. It's beyond baffling why VS insists on force-closing it before opening it as a project, when it clearly can have it open in at least up to _three_ different loaded views (Solution Explorer, text-view, and Project Properties view).
---
### Original Comments
#### Visual Studio Feedback System on 11/6/2019, 03:13 AM:
Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.
Contributor guide
Assessment
This issue has not been assessed yet.