“在指定文件夹中找不到 .NET 程序集 {AssemblyName}" [英] "Can't find the .NET assembly {AssemblyName} in specified folders"

查看:23
本文介绍了“在指定文件夹中找不到 .NET 程序集 {AssemblyName}"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想将 sln 文件加载到 Visual NDepend 并不断收到此错误:

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

在指定文件夹中找不到 .NET 程序集 {AssemblyName}.是否正确编译?NDepend 项目是否缺少 .NET aseembly 的包含文件夹?

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:

C:codedepotProductStageIA路径下的程序集不会出现该错误,C:codedepotProduct路径下会出现该错误IA

The error won't occur in assemblies under the path C:codedepotProductStageIA, and will occur under C:codedepotProductIA

我在使用 Visual NDepend 时采取的步骤:

The steps I am taking while using Visual NDepend:

  1. 打开 NDepend
  2. 点击分析 VS 解决方案和 VS 项目
  3. 浏览
  4. 查找 sln 的特定实例.
  5. 点击打开
  6. 发生错误

我按照相同的步骤操作,但在不同的路径中找到相同的解决方案,错误消失了!组件是一样的!任何帮助将不胜感激.

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.

推荐答案

这肯定来自读取 .sln 文件并尝试推断程序集所在的文件夹时出现的问题.

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

通常 NDepend 期望分析 .sln DEBUG 配置.这是因为当NDepend可以访问PDB时,它可以进行更深入的分析,解释这里

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

要解决此问题,您可以转到 NDepend 项目属性 > 分析代码 > 展开目录面板 > 确保引用的目录是包含所有程序集的目录.

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.

然后你可以使用 NDepend Project Properties > Paths referenced 来定义如何引用目录路径(relative/absolute/envvar...)

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

这篇关于“在指定文件夹中找不到 .NET 程序集 {AssemblyName}"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆