I have program that works fine in my windows 8 x64. But when i try to run it in my laptop with windows 7 x64 i have some problems.
errors:
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: URI formats are not supported.
A first chance exception of type 'System.BadImageFormatException' occurred in Emgu.CV.dll
Additional information: You tried to load the wrong format. (Excluded from the HRESULT: 0x8007000B)
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Target call threw an exception.
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Target call threw an exception.
'InzV2.vshost.exe' (CLR v4.0.30319: InzV2.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml.resources\v4.0_4.0.0.0_pl_b77a5c561934e089\System.Xaml.resources.dll'. Module was built without symbols.
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
Additional information:Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception.
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception., line number 3, position 9.
An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception., line number 3, position 9.
This errror looks like this:
I'm using Emgu.CV lib from Nuget called: myEmguCV.Net.
even if i try just crete new project with only:
BackgroundSubtractorMOG2 pMog11 = new BackgroundSubtractorMOG2(0, 80, false);
i have error..
This error occurs when unmanaged assembly is compiled for different platform than your .NET code is currently being compilled to.
For example if the unmanaged dll are in x86 architecture and you are trying to compile your code to x64 .NET runtime, you will get this type of error.
In the image you have provided it seems that you are trying to compile the code to x86 architecture and your EmguCV unmanaged .dlls are probably x64 based.
So go to
Project -> Properties -> Build -> tick the platform that matches the platform for which an unmanaged dll is compiled (x86, x64) (probably in your case it should be x64).
Related
I have a MVC application, which is referring another project (B) which is a x86 project has one Vc++ dll reference.
When I am trying to run the B project as a console application as start up project it is properly running.
But when I am accessing the same from MVC application , Am getting BadImageFormatException or TypeInitializationException.
I used Assembly trace and am getting exceptions as bellow from each place one by one
BinaryAssemblyInfo Exception thrown:
'System.Runtime.Serialization.SerializationException' in mscorlib.dll
Additional information: Unable to find assembly 'NI.Framework.Logger,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b98c50443551b471'.
RealProxy.cs
'System.Runtime.Serialization.SerializationException' in mscorlib.dll
Additional information: Unable to find assembly 'NI.Framework.Logger,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b98c50443551b471'.
Exception thrown: '.ModuleLoadException' in
MsgComWrapper_4.0.dll Additional information: The C++ module failed to
load while attempting to initialize the default appdomain.
Action method dispatcher.cs: Exception thrown:
'System.TypeInitializationException' in System.Web.Mvc.dll
Additional information: The type initializer for '' threw an
exception.
AsyncControllerActionInvokers.cs
Exception thrown: 'System.TypeInitializationException' in
System.Web.Mvc.dll
Additional information: The type initializer for '' threw an
exception.
I have tried many trail and error but not worked.
Well, AFAIK you have 2 options:
1. You can build your mvc app to x86. It will work on x64, it just will not use all the power x64 architecture can offer.
2. You can run your app on a x86 machine. That would also work
The only way to have a "true" AnyCpu app is to have all your dlls built for AnyCpu. Its very annoying and not intuitive and I have suffered a lot over this over time, but this is the reality. I'm still sure there is a better solution that I don't know of, even though I have spent a decent amount of time looking for it and found nothing
I create a new C# Windows Form project in Visual Studio 2013 Update 5. I do not change it in any way. It debugs properly as usual. As soon as I change the Platform target to x64, the debugger shows this error:
System.AccessViolationException was unhandled
Message: An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
This happens in every 5 times of debugging. Do you have any idea on what may be causing this error and how it can be fixed?
I wrote a program using kinect SDK v2.0 with wpf. I added the Microsoft.Kinect.dll in References, but when I run the program I get this error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in test.exe
Additional information: Could not load file or assembly 'Microsoft.Kinect.dll' or one of its dependencies. The specified module could not be found.
Does anybody know how to fix this error?
I'm doing Web camera App in Visual Studio 2012. When I build my program, I got this type of error.An unhandled exception of type System.TypeInitializationException occurred in Emgu.CV.dll
Additional information: The type initializer for Emgu.CV.CvInvoke threw an exception.
Error Log:
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
A first chance exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll
A first chance exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
Additional information: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
The thread '<No Name>' (0x19d4) has exited with code 0 (0x0).
The program '[8784] CameraApp.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[8784] CameraApp.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
Not sure what may be causing them, but you could set the debugger to stop at the very first first chance exception so you atleast get an idea of what may be causing the problem.
To do this go to Debug/Exceptions...
On the exceptions dialog box, click the Throw check box for the Common Language Runtime Exceptions this cause the debugger to stop immediatelly on the first change exception....and give you an idea of what is going on....
I hope this helps...
I get this error when I run my app in a 64 bit OS. If your OS is 64 bit, that is the culprit.
This just started happening with an application that has been working:
"A first chance exception of type 'System.DllNotFoundException' occurred in PresentationCore.dll
A first chance exception of type '.ModuleLoadException' occurred in PresentationCore.dll
A first chance exception of type 'System.TypeInitializationException' occurred in mscorlib.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in mscorlib.dll"
How do I figure out which dll is missing?
TIA for any hints...
You can use fuslogvw.exe to check for missing assembly dependencies, or Depends.exe for native dependencies.