dotnet / dotnet/project-system

Unload/reload a project in VisualStudio may leave something broken

Open
#5,977 6 comments 1 reaction 1 assignee Claimed by @drewnoakes View on GitHub
Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Visual Studio Version**:
Microsoft Visual Studio Community 2019
Version 16.4.3

**Summary**:
Similar to https://github.com/dotnet/project-system/issues/3773
After upgrading a few project to new-style csproj file, some projects (not necessarily those upgraded!) became 'Skipped' while Clean/Build/Rebuild operations in VisualStudio. Especially similar to report from Nekromancer - I of course checked the checkbox list in Configuration Manager and all projects were selected to be built.

**Steps to Reproduce**:
I cannot guarantee a successful repro, because it's already fixed on my machine.
I can only summarize the that I did during "upgrading" projects.
The "porting" was done manually by on project-by-project basis:
0) do not close Solution, do not close VisualStudio, keep Solution open
1) unload specific old-style project
2) manually edit csproj file so it's now in new-style
3) remove packages.json, add packagereferences to csproj
4) load the project back
5) trim AssemblyInfo
6) try to build the project or whole solution

**Expected Behavior**:
After re-loading all projects, all projects in Solution are Cleaned/Built/Rebuilt when I try cleaning/building/rebuilding the Solution respectively.

**Actual Behavior**:
Some (most) projects were skipped without any log message.
Typical build output was:
`==== Build: 0 succeeded, 0 failed, 0 up-to-date, 5 skipped ====`
Once in every few attempts I got most-recently-upgraded project start responsing and get cleaned/built, but none of its dependencies or other unrelated projects in the same solution.

**User Impact**:
Irritation. No further impact, as I found a simple workaround.
https://github.com/dotnet/project-system/issues/3773 suggested removing and adding the project to the solution, it was not necessary. Closing the solution and reopening it was enough - after reopening the solution everything was back to normal.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.