[英]How to Deploy c# project with all dependencies in visual studio 2012
I have created a small c# program in visual studio 2012, I used two external dll libraries. 我在Visual Studio 2012中创建了一个小型c#程序,我使用了两个外部dll库。 When I build the project for release, it creates the release file with a bunch of other files, including the external dll's I used.
当我构建要发布的项目时,它会与其他文件(包括我使用的外部dll)一起创建发布文件。 It works on my computer, but if I copy that whole release file to another computer it just gives me an error message and exits.
它可以在我的计算机上运行,但是如果我将整个发行文件复制到另一台计算机上,它只会给我一条错误消息并退出。 What else does the program need to run?
该程序还需要运行什么?
The error message is: 错误消息是:
The application was unable to start correctly(0x000007b). 应用程序无法正确启动(0x000007b)。 click OK to close the application.
单击确定关闭该应用程序。
I suspect that your error code is actually 0xC000007B (STATUS_INVALID_IMAGE_FORMAT), rather than 0x0000007B (INACCESSIBLE_BOOT_DEVICE). 我怀疑您的错误代码实际上是0xC000007B (STATUS_INVALID_IMAGE_FORMAT),而不是0x0000007B(INACCESSIBLE_BOOT_DEVICE)。 The former is common when your application encounters a runtime mixup between the 32 and 64 bit versions of a DLL.
当您的应用程序在DLL的32位和64位版本之间遇到运行时混合时,前者很常见。
What could be happening is that your application (say it's 32 bit) has a dependency on a certain DLL, call it FOO.DLL. 可能发生的情况是您的应用程序(例如32位)依赖于某个DLL,称为FOO.DLL。 When run on your local machine, you are picking up the correct version of the 32 bit version of FOO.DLL on your path.
在本地计算机上运行时,您将在路径上获得FOO.DLL的32位版本的正确版本。 But when you deploy to the other machine, you are picking up a 64 bit version from somewhere on the system path.
但是,当您部署到另一台计算机时,您将从系统路径上的某个位置获取64位版本。 The INVALID_IMAGE_FORMAT error is thrown when the loader finds a 64 bit DLL trying to be loaded into your 32 bit app.
当加载程序找到试图加载到32位应用程序中的64位DLL时,将引发INVALID_IMAGE_FORMAT错误。
One way to fix this is by identifying the DLL and redistributing the correct version with your application. 解决此问题的一种方法是,识别DLL并在您的应用程序中重新分发正确的版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.