2

I am simply trying to load sln files in to Visual NDepend and keep getting this error:

Can't find the .NET assembly {AssemblyName} in specified folders. Has it been compiled properly? Is the NDepend project missing the containing folder of the .NET aseembly?

The weirdest thing is that this error doesn't occur for the same assemblies under a different path. For example:

The error won't occur in assemblies under the path C:\code\depot\Product\Stage\IA\, and will occur under C:\code\depot\Product\IA

The steps I am taking while using Visual NDepend:

  1. Open NDepend
  2. Click on Analyze VS solutions and VS projects
  3. Browse
  4. Find a particular instance of a sln.
  5. Click open
  6. Error occurs

I follow these same steps but find the same solution in a different path and the errors disappear! The assemblies are identical! Any help would be very much appreciated.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
jshaf
  • 309
  • 1
  • 18

1 Answers1

2

This certainly comes from problem when reading the .sln file and trying to infer the folders in which your assemblies are.

Typically NDepend expects to analyze a .sln DEBUG configuration. This is because when NDepend have access to PDB it can analyze more in-depth, explanation here

To solve this, you can go to NDepend Project Properties > Code to Analyze > unfold the Directories panel > make sure directories referenced are the one that contain all your assemblies.

Then you can use NDepend Project Properties > Paths referenced to define how directories paths are referenced (relative/absolute/envvar...)

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • Excellent! Thanks! This did the job. – jshaf Dec 12 '16 at 18:52
  • from NDepend does analyzing a .sln's Debug configuration have any advantages for Release when it comes to determining dependencies? – jshaf Dec 12 '16 at 19:40
  • 1
    the dependencies are identical no matter analyzing Debug or Release – Patrick from NDepend team Dec 13 '16 at 10:10
  • how does NDepend know where to look (Debug or Release)? I am trying to deploy a utility that uses NDepend's API and am wanting NDepend to look in Common\Bin\Release as opposed to Common\Bin\Debug – jshaf Dec 13 '16 at 22:38
  • 1
    NDepend chooses Debug by default, this is a behavior we plan to make configurable. For now with NDepend.API you just have to replace Debug with Release in all dirs referenced. Notice that with Release you might not have access to PDB file and will lose some info (see the link in my answer) – Patrick from NDepend team Dec 15 '16 at 10:10
  • 1
    Thanks for the clarification! You have been a great help. – jshaf Dec 15 '16 at 18:32