简体   繁体   English

在IIS上发布时EmguCV异常

[英]EmguCV Exception when published on IIS

My ASP.NET App works fine if I debug or run it on my local IIS. 如果我在本地IIS上调试或运行它,我的ASP.NET App可以正常工作。 But if I publish it onto an IIS, it looks like EmguCV looses the dlls it needs. 但是,如果我将其发布到IIS上,则好像EmguCV失去了所需的dll。 The bin folder of my VS project an the bin folder on the IIS are identical. 我的VS项目的bin文件夹与IIS上的bin文件夹相同。

The following exception occurs: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. 发生以下异常:'Emgu.CV.CvInvoke'的类型初始化器引发了异常。 StackTrace: at Emgu.CV.CvInvoke.cvCreateImageHeader(Size size, IPL_DEPTH depth, Int32 channels) at Emgu.CV.Image 2.AllocateData(Int32 rows, Int32 cols, Int32 numberOfChannels) at Emgu.CV.Image 2.set_Bitmap(Bitmap value) at CustomerserviceWizard.ImageHelper.DecodeUrl(LuminanceSource source, Bitmap bitmap, List`1 methods) in :line 213 StackTrace:在Emgu.CV.Image 2.处为Emgu.CV.CvInvoke.cvCreateImageHeader(大小大小,IPL_DEPTH深度,Int32通道)在Emgu.CV.Image 2.AllocateData(Int32 rows, Int32 cols, Int32 numberOfChannels) at Emgu.CV.Image处为2.AllocateData(Int32 rows, Int32 cols, Int32 numberOfChannels) at Emgu.CV.Image .set_Bitmap(位图)值)在第213行的CustomerserviceWizard.ImageHelper.DecodeUrl(LuminanceSource源,位图位图,列表1方法)处

Any help is appreciated. 任何帮助表示赞赏。

我曾经遇到过类似的问题,也许这对您有帮助:请检查IIS应用程序池设置,并确保在“高级设置”下启用32位应用程序。

Alright, after a lot of research and grey hair I finally convinced my boss to just use an Desktop PC to process images with EmguCV. 好吧,经过大量研究和研究,我终于说服了我的老板只使用台式PC通过EmguCV处理图像。 The (quite obvious) reason for the exception was the missing nVidia Cuda GPU in the server. (非常明显的)例外原因是服务器中缺少nVidia Cuda GPU。

Error shown when i tried to execute EmguCV on IIS - Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 当我尝试在IIS上执行EmguCV时显示错误- Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E) Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Exception - The type initializer for 'Emgu.CV.CvInvoke' threw an exception . 异常The type initializer for 'Emgu.CV.CvInvoke' threw an exception

In my case, I solved this by enabling UI Desktop experience for windows server (In my case - Windows Server 2012 R2) because Microsoft never enabled that feature on Windows Server by default. 就我而言,我通过为Windows服务器(在我的情况下为Windows Server 2012 R2)启用UI桌面体验解决了此问题,因为默认情况下,Microsoft从未在Windows Server上启用该功能。


Solution

For Windows Server 2008 对于Windows Server 2008

  1. Go to Start >> Administrative Tools >> Server Manager. 转到开始>>管理工具>>服务器管理器。
  2. At left side pane, click on Features.Under the Features Summary section, click on Add Features. 在左侧窗格中,单击功能。在功能摘要部分下,单击添加功能。
  3. On the Select Features page, select the Desktop Experience check box. 在“选择功能”页上,选中“桌面体验”复选框。
  4. Review required features that need to be installed and then click Add Required Features, click Next. 查看需要安装的必需功能,然后单击“添加必需功能”,再单击“下一步”。
  5. At Confirm Installation Selections page, make sure that Desktop Experience feature will get installed, click Install. 在“确认安装选择”页面上,确保将安装Desktop Experience功能,然后单击“安装”。
  6. At Installation Results page, you will be asked to reboot the server to finish the installation process. 在“安装结果”页面上,将要求您重新引导服务器以完成安装过程。
  7. Just click Close, and then click Yes to reboot the server. 只需单击“关闭”,然后单击“是”以重新启动服务器。
  8. Once server restarts log in to server and server will finish remaining installation steps. 服务器重新启动后,登录服务器,服务器将完成剩余的安装步骤。

For Windows Server 2012 对于Windows Server 2012

  1. Go to Start >> Administrative Tools >> Server Manager. 转到开始>>管理工具>>服务器管理器。
  2. At Server Manager, click on Features. 在服务器管理器上,单击“功能”。
  3. In the Server Manager details pane, under Features Summary, click Add features. 在服务器管理器详细信息窗格中的“功能摘要”下,单击“添加功能”。
  4. This will start the Add Features Wizard. 这将启动“添加功能向导”。
  5. Now, in the Features list, select Desktop Experience, and click Install. 现在,在“功能”列表中,选择“桌面体验”,然后单击“安装”。

Hope this solution can help you :) 希望此解决方案可以为您提供帮助:)

Links - Solution from GitHub & Description with screenshot 链接- 来自GitHub的解决方案说明以及屏幕截图

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

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