为了更好地理解我的问题NUnit: Could not load file or assembly 'some.dll' or one of its dependencies. The specified module could not be found我试图通过摆脱NUnit来降低复杂性。现在我编写了一个简单的控制台应用程序(C#),它与c ++ / cli包装器交互,后者调用公司框架c ++ dll。
Dumpbin说所有组件都是32位。 Visual Studio将控制台应用程序和包装器设置为x86。在x86机器上,控制台应用程序的工作方式类似于魅力,在x64上它没有,除非从我的Visual Studio 2013调用附加调试器(在没有调试器的情况下从Visual Studio运行时不起作用)。程序集设置为“Systemeigenes Codedebugging aktivieren”(激活本机?代码调试)并停用Visual Studio主机进程。 “它不起作用”用这样的东西代表:
import * as express from 'express';
import {ng2engine} from 'angular2-universal-preview';
// Angular 2
import {App} from './src/app';
let app = express();
// Express View
app.engine('.ng2.html', ng2engine);
app.set('views', __dirname);
app.set('view engine', 'ng2.html');
// static files
app.use(express.static(__dirname));
app.use('/', (req, res) => {
res.render('index', { App });
});
app.listen(3000, () => {
console.log('Listen on http://localhost:3000');
});
我尝试在64位计算机上使用依赖walker(x86版本)进行性能分析,但是在加载IMM32.DLL后它就死了。 x86机器上的输出如下:
SetUp : System.IO.FileLoadException : Could not load file or assembly 'The_Wrapper.DLL' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
当我正在开发的软件产品(x86,C#WinForms)使用包装器时,即使没有调试器,它也能在x64上运行,但只能在我的开发PC上使用。
我在俯瞰什么?哪些工具可以帮助我?
答案 0 :(得分:2)
有点尴尬,但无论如何都会分享:
我添加到此现有项目的公司框架库使用Jungo USB Driver。由于未知原因,文件wdapi1020.dll已签入并复制到我的bin目录。不幸的是,这是该文件的x86版本。当我终于弄清楚我必须删除它时,PlainConsoleApplication使用了SysWOW64中的那个,一切都很顺利。现在我必须说服我们的管理员在buildserver或框架开发人员上安装驱动程序来改变他们对Jungo驱动程序的使用......它仍然会很有趣。
对于那些感兴趣的人,以下是我的发现:我采用了问题末尾提到的软件产品并安装了它(而不是从bin文件夹中复制它)。当我将控制台应用程序放入其文件夹时,它突然起作用。我开始比较这些文件并发现实际上有一个太多了。删除了我的脸上有一个biiig微笑。