因此,我试图使用NDepend API为代码上的一些度量标准设置一个项目(运行得很好),但是,当我试图在它上运行一个测试框架(NUnit)时,我会被抛出TypeInitializationExceptions。
下面是一些代码来重现我所得到的错误:
$NDependInstallPath$\lib\NDependAPI API,将副本设置为false。创建一个类如下所示:
公共类NDependProjectLoader {公共LoadAnNDependProject() { var provider =新NDependServicesProvider();}}"{"Could not load file or assembly 'NDepend.Platform.DotNet' or one of its dependencies. The system cannot find the file specified.":"NDepend.Platform.DotNet"}".
“程序可执行程序集必须生成为$NDependInstallPath$\”
因此,问题是,除了控制台应用程序之外,如何使用NDepend API呢?例如,这里我想通过一个测试运行程序来实现。另一个明显的候选是IIS应用程序。我漏掉了什么明显的东西吗?
发布于 2014-12-02 17:34:18
事实上,问题来自于程序集的解析。您必须告诉CLR在哪里找到NDepend程序集(即在dir $NDependInstallPath$\Lib中),您有两个选项可以这样做。假设$NDependInstallPath$是"C:\NDepend“,例如:
https://stackoverflow.com/questions/27241485
复制相似问题