简体   繁体   English

通过C ++ / CLI包装器将本地C ++ dll与C#连接起来,Visual Studio问题

[英]Connecting native C++ dll with C# by C++/CLI wrapper, Visual Studio issue

I'm working on a three projects. 我正在做三个项目。

The first one is a native C++ dll, let's name it as a native.dll. 第一个是本机C ++ dll,让我们将其命名为native.dll。

The second is a C++/CLI dll (man.dll), which contains a bunch of wrapper functions (native.dll is statically linked). 第二个是C ++ / CLI dll(man.dll),其中包含一堆包装函数(native.dll是静态链接的)。

Finally, the man.dll is used( as a reference) in a C# WinForm project. 最后,在C#WinForm项目中使用man.dll(作为参考)。 Everything work perfect, I can use a native function in C#, but after a couple(!) builds (in debug mode) the C# project, I can't recompile native.dll, I can't even delete this file because Windows says that the file is being in use by Visual Studio. 一切工作正常,我可以在C#中使用本机函数,但是在一对夫妇(!)构建(以调试模式)C#项目之后,我无法重新编译native.dll,甚至无法删除此文件,因为Windows会说该文件正在被Visual Studio使用。 Why? 为什么?

I'm working in Visual Studio 2010. 我正在Visual Studio 2010中工作。

Virus scanner can definately cause problems but in my experience they tend to be intermittent. 病毒扫描程序肯定会引起问题,但以我的经验来看,它们往往是间歇性的。 Have you tried the obvious things: - restart visual studio? 您是否尝试过显而易见的事情:-重新启动Visual Studio? - logout then back in? -注销然后重新登录? - reboot? - 重启?

Silly as it sounds in this day and age - sometimes it really can be that simple... 在当今时代听起来很愚蠢-有时确实如此简单...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM