문제

BACKGROUND

As time goes by, I find myself more and more turning to NDepend to gain insight into the design/implementation of legacy applications.

QUESTION

Rather than adding JustMyCode to CQL queries, is there a way to permanently configure NDepend (at the project level) to simply ignore the .NET Framework? I could be wrong, but I am pretty sure that this feature was supported by NDepend v3.

EXAMPLE

  1. Open your solution in Visual Studio and click Rebuild
  2. create an NDepend project based on your solution file (*.sln)
  3. run the Analysis
  4. open the interactive (non-HTML) Dependency Graph
  5. click the Reset arrow in the top left corner (hint: the recycling icon)
  6. click reset to application assemblies only
  7. observe
    • you will no longer see references to the .Net Framework (note: the blue writing is gone)
  8. right click on one of your assemblies: Select Types
  9. click that I use directly
  10. the following CQL will appears in the queries window:
    • from t in Types where t.IsUsedBy ("MyCompany.MyProduct.MyAssemblyName") select new { t, t.NbILInstructions }
  11. observe
    • more than likely you will now see .NET Framework references (note: the blue writing is back) in the query results window
    • add JustMyCode to the CQL query and the .NET references disappear again: from t in JustMyCode.Types where t.IsUsedBy ("MyCompany.MyProduct.MyAssemblyName") select new { t, t.NbILInstructions }

CONTEXT

  • Application: NDepend version 4.1.0.6871
  • View: Dependency Graph
도움이 되었습니까?

해결책

The only two ways to ignore a .NET assemblies are:

  • Using notmycode/JustMyCode as you wrote
  • Remove the assembly from the Project Properties > Code to Analyze panel.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top