동일한 규칙 ID를 사용하지만 포함 된 MS 규칙 집합의 레벨이 상승하고 일부 규칙에 대한 작업의 심각도가 증가하는 여러 규칙 집합 파일을 작성 중입니다. 문제는 VS2010에서 FXCop_VS2010_HIGLevel1.ruleset이 잘로드되는 동안 내 FXCop_VS2010_HIGLevel2.ruleset 파일을로드하는 중에 오류가 발생했다는 것입니다. 그들은 본질적으로 같은 모양 :FXCop 룰셋의 문제점은 무엇입니까?
FXCop_VS2010_HIGLevel1.ruleset
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="HIG VS2010 Code Analysis Rules Level 1" Description="These rules expand on the basic design guideline rules to maximize the usability and maintainability issues that are reported. Extra emphasis is placed on naming guidelines. Consider including this rule set if your project includes library code or if you want to enforce the highest standards for writing maintainable code." ToolsVersion="10.0">
<Include Path="BasicCorrectnessRules.ruleset" Action="Default" />
<Include Path="SecurityRules.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1000" Action="None" />
<Rule Id="CA1001" Action="None" />
...
<Rule Id="CA2239" Action="Warning" />
<Rule Id="CA2240" Action="None" />
<Rule Id="CA2242" Action="None" />
<Rule Id="CA2243" Action="None" />
</Rules>
</RuleSet>
FXCop_VS2010_HIGLevel2.ruleset
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="HIG VS2010 Code Analysis Rules Level 2" Description="These rules expand on the basic design guideline rules to maximize the usability and maintainability issues that are reported. Extra emphasis is placed on naming guidelines. Consider including this rule set if your project includes library code or if you want to enforce the highest standards for writing maintainable code." ToolsVersion="10.0">
<Include Path="BasicCorrectnessRules.ruleset" Action="Default" />
<Include Path="BasicDesignGuidelineRules.ruleset" Action="Default" />
<Include Path="SecurityRules.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1000" Action="Warning" />
<Rule Id="CA1001" Action="None" />
...
<Rule Id="CA2239" Action="Warning" />
<Rule Id="CA2240" Action="None" />
<Rule Id="CA2242" Action="None" />
<Rule Id="CA2243" Action="None" />
</Rules>
</RuleSet>
당신은 그들이 본질적으로 같은 걸 볼 수 있습니다. 수준 2는 BasicDesignGuideRules.ruleset을 추가하고 일부 규칙에 대한 동작을 변경합니다 (즉, CA1000은 수준 1의 "없음"에서 수준 2의 "경고"로 변경됨).
이 내가 정적 분석 도구 \ 규칙에 레벨 2 룰셋 파일을 넣을 때 내가 VS2010에서 얻을 오류가 폴더 설정된다
어떤 아이디어 왜 이런 일이? 필자는 레벨 2 XML을 한 줄씩 살펴 보았고 레벨 1과 비교하여 파일을 실행했습니다. 유일한 차이점은 예상했던 것입니다. 메모장 + +를 사용하여 인쇄되지 않는 문자와 CRLF 이외의 다른 문자를 적절한 위치에 표시했습니다. 나는 혼란 스럽다. 당신이 당신의 의견에 privided으로
불행히도 귀하의 게시물에있는 정보로 문제를 재현 할 수 없습니다. Visual Studio 활동 로그 (http://msdn.microsoft.com/en-us/library/ms241272(v=vs.100).aspx)를 설정하고 검사하여 자세한 내용을 확인할 수 있습니다. 그렇지 않으면 문제를 재현 할 수있는 레벨 2 룰 세트의보다 완전한 버전을 게시 할 수 있습니까? –
파일을 첨부 할 수있는 방법이 없습니다.) 그리고 링크를 제공하기 위해 외부에 저장하는 방법이 없습니다.
댓글에 코드로 게시 할 콘텐츠가 너무 많습니다. 전체 파일을 게시하는 방법에 대한 제안? BTW - 'Action = "CriticalError"'및 'Action = "CriticalWarning"을 각각 "Error"및 "Warning"으로 변경하여 오류를 제거 할 수있었습니다. 왜 갑자기 이것이 일어나기 시작했는지 나는 모른다. "CriticalError"및 "CriticalWarning"은 유효한 조치입니다. 그들은 원래 규칙 집합에있었습니다. 추가 규칙을 추가했는데 갑자기 액션에 대한 잘못된 값이되었습니다 ... –