C#崩溃时加载C ++ DLL [英] C# crash when loading C++ dll

查看:189
本文介绍了C#崩溃时加载C ++ DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序是用C#NET 2.0编写的,它使用C ++中使用Microsoft Visual Studio 2008 SP1编写的dll中的外部函数。
如果我从程序放置的目录中删除了dll,程序崩溃,它应该使用dll.That是正常的。

My program is written in C# NET 2.0,it's using external functions from a dll written in C++ using Microsoft Visual Studio 2008 SP1. If I remove the dll from the directory the program is placed,the program crashes at the moment it should use the dll.That's normal.

但用户那些使用我的程序在同一个地方得到相同的错误,而不移动dll.They都有C ++ Redistributable 2008从> here <

But the users that are using my program get the same error at the same place without moving the dll.They all have C++ Redistributable 2008 from >here<

这是否因为我制作了程序

Does it happen because I made the program in .NET 2.0 instead of NET 3.5 or it happens ,because the redistributable should be an older version?

编辑:注意,程序运行得很好。

Note for me,the program runs fine.

>> new thread<< a>

>>new thread<<

推荐答案

它最有可能是错误的运行时。确保分发的是正确的。这些将总是在你的开发盒上工作,因为运行时在路径中。对于测试软件,我使用windows xp虚拟机。我将虚拟机设置为完全全新的安装,安装我知道我需要的组件(.NET框架等),然后运行我的安装程序。您将遇到令人惊讶的数量的设置问题。

Its most likely the wrong runtime. Make sure you are distributing the correct one. These will always work on your dev box because the runtimes are in the path. For testing software, I use a windows xp virtual machine. I set up the virtual machine as a completely fresh install, install the components I know that I need (.NET framework, etc.), then run my installer. You will run into a surprising number of setup issues doing this.

这篇关于C#崩溃时加载C ++ DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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