dotnet / dotnet/project-system

CodeAnalysisRuleSet property is being cleared when deleting an unused ruleset file from a project

Open
#6,265 0 comments 1 reaction 0 assignees View on GitHub
good-first-issue Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Visual Studio Version**: 2015, 2019

**Summary**:
When you delete a ruleset file from a project, the CodeAnalysisRuleSet property is being cleared even when it was not referencing the deleted ruleset.
Happens in both old-style and new-style projects.

**Steps to Reproduce**:

1. Create a project with rulesets A and B.

2. Set CodeAnalysisRuleSet to ruleset A.

3. Delete ruleset B.

**Expected Behavior**: CodeAnalysisRuleSet still points to ruleset A.

**Actual Behavior**: CodeAnalysisRuleSet is cleared.

**User Impact**: User's rulesets are being reset without the user knowing about it.

[CodeAnalysisRuleSetBeingCleared.zip](https://github.com/dotnet/project-system/files/4734788/CodeAnalysisRuleSetBeingCleared.zip)

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.