问题
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:
- Open NDepend
- Click on Analyze VS solutions and VS projects
- Browse
- Find a particular instance of a sln.
- Click open
- 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.
回答1:
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...)
来源:https://stackoverflow.com/questions/41067190/cant-find-the-net-assembly-assemblyname-in-specified-folders