简体   繁体   English

无法在64位操作系统上的VS2015中加载“ lpsolve55.dll”

[英]Unable to load “lpsolve55.dll” in VS2015 on 64-bits OS

For a project I am working on, I need to solve a mathematical model. 对于我正在从事的项目,我需要解决一个数学模型。 I chose to do this using Microsoft.Solver.Foundation and the SolverFoundation.Plugin.LpSolve plugin. 我选择使用Microsoft.Solver.Foundation和SolverFoundation.Plugin.LpSolve插件来执行此操作。 Both associated .dll files for these extension seem to work fine, as VS2015 recognizes and references them without a problem and compiles and runs my program without errors. 与这些扩展名相关联的两个.dll文件似乎都可以正常工作,因为VS2015可以毫无问题地识别并引用它们,并且可以编译并运行我的程序而不会出现错误。

This is however up untill I try to actually solve my optimization, which needs "lpsolve55.dll" to work. 但是,直到我尝试实际解决优化问题为止,这需要“ lpsolve55.dll”才能起作用。 I have downloaded this dll and put it in my project's bin/Debug folder, but for some kind of reason VS2015 just doesn't recognize it. 我已经下载了该dll并将其放在项目的bin / Debug文件夹中,但是由于某种原因,VS2015不能识别它。 Ie

  • I can't reference it by simply browsing to it from my "Add Reference" tab. 我不能仅通过从“添加引用”选项卡浏览到它来引用它。
  • It's impossible to (un-)register it via the regsvr32 cmd-prompt application, as it doesn't have any DLL (Un-)registry entry points. 无法通过regsvr32 cmd提示应用程序(取消注册)它,因为它没有任何DLL(取消注册)入口点。
  • The TlbImp.exe cmd-prompt application can't handle it. TlbImp.exe cmd提示应用程序无法处理它。

So basically, after discovering the above (after trying the most-common internet solutions), I still feel quite dissatisfied to get the error message while I try to solve the optimization - 因此,基本上,在发现上述内容之后(尝试了最常见的Internet解决方案之后),我仍然很不满意在尝试解决优化问题时收到错误消息-

Unable to load DLL 'lpsolve55.dll': The specified module could not be found. 无法加载DLL'lpsolve55.dll':找不到指定的模块。 (Exception from HRESULT: 0x8007007E) (来自HRESULT的异常:0x8007007E)

The wierd part is also that I have another project in which I solve a similar problem, where there are absolutely no problems at all using lpsolve55.dll.... 更奇怪的是,我还有另一个项目可以解决类似的问题,使用lpsolve55.dll绝对没有问题。

Some quick facts: 一些事实:

  • I reference .NET framwork 4.5.2. 我参考.NET框架4.5.2。 I have changed it to 4.5 as well as 4.0, but this didn't change anyting. 我将其更改为4.5和4.0,但这并没有改变。
  • For as far as I can tell, the bin/debug folder of my projects are identical. 据我所知,我项目的bin / debug文件夹是相同的。
  • I am working on a fully updated windows 10 OS, 64 bits, while using visual studio 2015. 我在使用Visual Studio 2015时正在开发完全更新的Windows 10 OS,64位。

My question would thus be whether or not some of you have encountered a similar problem and if you were able to solve it in some way. 因此,我的问题是你们中的某些人是否也遇到过类似的问题,以及您是否能够以某种方式解决它。

Highly appreciated! 高度赞赏!

After some careful analysis, I have found the answer to the problem. 经过仔细分析,我找到了问题的答案。 To be honest, as most things are, it was quite simple in the end. 坦白说,就像大多数事情一样,最后很简单。 The lpsolve55.dll wasn't recognized because I didn't have my new bin-folder in the Path, which I did have with my old project. 无法识别lpsolve55.dll,因为我在Path中没有新的bin文件夹,而我在旧项目中确实有。 I simply forgot. 我简直忘记了。

On a further note however, after the lpsolve55.dll directory was added to the path, I still got an error telling me there was no model to be found that could solve my directive. 但是,还需要注意的是,在将lpsolve55.dll目录添加到路径后,我仍然收到一条错误消息,告诉我没有找到可以解决我的指令的模型。 Since the error occured when I was calling the LPSolverDirective(), some research landed me on the following page: 由于在我调用LPSolverDirective()时发生了错误,因此一些研究使我进入了以下页面:

http://lpsolve.sourceforge.net/5.5/MSF.htm http://lpsolve.sourceforge.net/5.5/MSF.htm

Above page gives a complete and stable way of how to acces lpsolve55.dll using the LPSolverPlugin straight out of Microsoft.Solver.Foundation.dll. 上一页提供了一种直接使用Microsoft.Solver.Foundation.dll来使用LPSolverPlugin访问lpsolve55.dll的完整,稳定的方法。 After following the method in the link that involves editing my projects' bin/Debug and bin/Release folders, I got the LP model up and running within no-time. 在遵循了涉及编辑项目的bin / Debug和bin / Release文件夹的链接中的方法之后,我立即启动了LP模型并使其运行。

Morale of the story - read the documentation. 故事的士气-阅读文档。 I am a bit of a beginner in programming entire multi-project solutions and using customly-added dlls, but hopefully this helps someone else experiencing the same. 在编写整个多项目解决方案和使用自定义添加的dll方面,我是一个初学者,但是希望这可以帮助其他经历过此问题的人。 In the end, I learned a lot by simply trying different methods of getting it to work, so no time was wasted. 最后,我通过尝试不同的方法使其工作而学到了很多东西,所以没有浪费时间。

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

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