BalaShiyamala / opencvdotnet

Automatically exported from code.google.com/p/opencvdotnet
0 stars 0 forks source link

File Not Found Exception : Exception from HRESULT: 0x8007007E #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Trying to execute applcations with OpenCV 1.0 and the OpenCVDotNet 0.7
release 
2. Deleting and adding the assembly references also does not solve the issue

What is the expected output? What do you see instead?
Application execution (any application which uses OpenCVDotNet)

What version of the product are you using? On what operating system?
OpenCVDotNet with OpenCV 1.0 on Windows XP Professional SP2 and VS2005

Please provide any additional information below.

The example provided with 0.7 reports that the OpenCVDotNet Assembly of
Version 1.0.2616.4315 is not found and refuses to execute, throwing a
FileNotFoundException

Original issue reported on code.google.com by s.adi...@gmail.com on 28 Feb 2007 at 9:02

GoogleCodeExporter commented 8 years ago
Which version of VC# are you using? I saw something like this happening with 
Visual
Studio.NET 2005.

Original comment by elad.ben...@gmail.com on 1 Mar 2007 at 12:53

GoogleCodeExporter commented 8 years ago
This is caused by the fact that when working with Visual Studio .NET, the 
search path
of DLLs is not derived directly from the system PATH. Therefore, your app can't
locate cv100.dll which is the main OpenCV dll file.
There are a few workarounds:
1) Tell VS.NET 2005 to look for DLLs in the OpenCV bin directory (done through 
the
Settings dialog).
2) Set the application to execute while the working directory is OpenCV bin 
directory.
3) Copy the DLLs from from OpenCV\bin to %SystemRoot%\System32.

See attached file for an example configuring .NET to run the program from 
OpenCV\bin
directory.

How about we do this copying of DLLs in our OpenCVDotNet library installation?

Original comment by elad.ben...@gmail.com on 5 Mar 2007 at 5:19

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by elad.ben...@gmail.com on 5 Mar 2007 at 5:20

GoogleCodeExporter commented 8 years ago

Original comment by elad.ben...@gmail.com on 5 Mar 2007 at 5:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Pardon me, but MEDIUM?

noone solved this problem ever, its still there and it seems noone cares....

too sad, but we are all to blame for trusting that when someone says something 
works
, it will, and its not our case is it?

for the record, i have the problem and there seems to be no light at the end, 
in my
case, ill just let it go and dont use opencvdotnet cuz it doesnt work, thats it

Original comment by homuncul...@gmail.com on 11 Jun 2008 at 12:58

GoogleCodeExporter commented 8 years ago
same problem, no solution..

I installed OpenCV 1.0 and OpenCVDotNet 0.7 and works well, but then I format 
the PC
and install opencv it again, and don't work, install in other pc and don't 
work, then
install opencv in another PC and it works well... 

how i can install it always well?

Original comment by evili...@gmail.com on 18 Jun 2008 at 11:27

GoogleCodeExporter commented 8 years ago
i think i found a solution to the problem.

For a better understanding i will shortly describe the problem as i understand 
it:

the problem
-----------

The reason for the occurence of the FileNotFoundException with HRESULT: 
0x8007007E
is, that dependencies (other dlls) of OpenCVDotNet.dll can not be found.

some additional info
--------------------

There are two sources for dlls needed for OpenCVDotNet.dll as far as i can see:
 - the opencv dlls
 - the visual c++ 2005 runtime libraries

the solution
------------

To ensure the opencv dlls can be found:

 - install opencv
 - follow the instructions from Comment2 (running the program in opencv/bin solved it
for me)

The solution for missing visual c++ 2005 runtime was:

 - installing visual c++ 2005 express (as found on the microsoft site).

Installing the visual c++ redistributable does NOT solve the problem, as 
OpenCVDotNet
links against the debug version of the c++ runtime, which is not included in any
redistributable file.

Hope this helps!

Original comment by kri...@gmx.de on 19 Jun 2008 at 6:24

GoogleCodeExporter commented 8 years ago
This worked for me: (I have VS2008)
-----------------------------------

I installed OpenCV first, then installed the OpenCVDotNet second.

I then opened the Examples.csproj in VS2008 and converted it.

I then removed all the references to OpenCVDotNet, OpenCVDotNet.Algorithms and
OpenCVDotNet.UI

I then added these projects from the OpenCVDotNet\src folder and fixed up the
references to be project references rather than the DLL's (converting the 
projects to
2008 as I went). I've found that this is usually the best thing for a number of
projects I work with where I get the FileNotFound exception.

I checked the library paths in c++ and it had found the C:\Program 
Files\OpenCV\lib
folder happily.

I pressed "Run" and off it went.

I've attached my VS2008 solution file and the other bits and bobs that it 
created.

Original comment by tim.stcl...@gmail.com on 2 Sep 2008 at 9:07

Attachments:

GoogleCodeExporter commented 8 years ago
When i try to run the sample code that i got from the googles tutorial
page ... here is the code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenCVDotNet.UI;
using OpenCVDotNet.Algorithms;
using OpenCVDotNet;

namespace WindowsFormsApplication1
{
   public partial class Form1 : Form
   {
       public CVCapture capture;
       public Form1()
       {
           InitializeComponent();
       }

       private void timer1_Tick(object sender, EventArgs e)
       {
           try
           {
               using (CVImage nextFrame = capture.QueryFrame())
               {
                   pictureBox1.Image = nextFrame.ToBitmap();
               }
           }
           catch(Exception k)
           {
               MessageBox.Show(k.ToString());
           }
       }

       private void Form1_Load(object sender, EventArgs e)
       {
           try
           {
               capture = new CVCapture(@"..\\..\avi.avi");
           }
           catch (System.Exception k)
           {
               MessageBox.Show(k.ToString());
           }

       }

   }

I got the error message
" Could not load file or Assembly 'OPenCVDotNet,
Version=1.0.2615.24735, Culture=neutral, PublicKeyToken=null' or one
of its dependencies . This application has failed to start because the
application configuration is incorrect . HRESULT:0x800736B1
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly
'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. This application has
failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem. (Exception from
HRESULT: 0x800736B1)
File name: 'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral,
PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException
(0x800736B1): This application has failed to start because the
application configuration is incorrect. Reinstalling the application
may fix this problem. (Exception from HRESULT: 0x800736B1)
  at WindowsFormsApplication1.Form1.timer1_Tick(Object sender,
EventArgs e)
  at System.Windows.Forms.Timer.OnTick(EventArgs e)
  at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsFormsApplication1
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase:
file:///C:/Documents%20and%20Settings/Anoop%20Krishnan%20G/My%20Documents/Visual
%20Studio%202008/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/
Debug/WindowsFormsApplication1.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e
089/System.Windows.Forms.dll
----------------------------------------
System
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/Sy
stem.Drawing.dll
----------------------------------------
System.Configuration
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50
a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
   CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System
.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

This is the error message i got when running , the application
compiles but run time errors are occuring  am using Visual Studio 2008
with OPENCV 1.0 with the OPENCVDOTNET.

Regards

Anoop Krishnan G

Original comment by anoopsame@gmail.com on 6 Dec 2008 at 12:27

GoogleCodeExporter commented 8 years ago
Hi friends 
i have tried all the solution for this error but still not able to solve this 
one.. 

Original comment by kirankum...@gmail.com on 14 Feb 2009 at 10:44

GoogleCodeExporter commented 8 years ago
Looks like that the problem that you are having is about the path of the 
Assemblies
references (in good spanish :P Debugger cannot found the path of the DDL's of
OpenCVDotNet...) (I Think...)

Original comment by digitalp...@gmail.com on 29 Apr 2009 at 6:39

GoogleCodeExporter commented 8 years ago
Well, problem is here: 
          capture = new CVCapture(@"..\\..\avi.avi");

You've used COM component to retrieve a file, then @"..\..\avi.avi" is refered 
to 
"c\avi.avi".

Original comment by ncthang1...@gmail.com on 30 Sep 2009 at 11:38