I am on Windows 64bit working with Visual Studio 2015. I have this WPF project with its C++ backend and it uses several additional packages such as OpenCV, EmguCV and DevExpress.
Now if I run as Release
, it compiles fine. Also if I go to the current directory via explorer and navigate to bin -> Release
then execute the .exe
file, it also runs fine.
Problem: The project does not work on any other machine: If I copy the whole Release folder and paste it onto another machine, and try to execute, it pops a "Could not load file or assembly" error. See Error Here and the full error below.
Insights: Those target machines used to be able to execute a Release just fine and the same way (Copy/Paste or Installer). The project targets .Net framework 4.5
and needs the 2013 + 2015 redistributable files. Everything is installed on the target machine. Also the Dlls that the error is mad about, exist physically in the Release folder. And when I build an installer (using Inno Setup
) I see all the needed and existing Dlls being included (OpenCv stuff and DevExpress).
There are like 10 OpenCv Dlls that are not shown within "Solution Explorer -> References" but physically exist in the Release Folder (we pasted them their). Now, if I remove these files from MY Release Folder, I get the exact same error. On the other hand, if I paste them in THEIR Release Folder, the error persists.
The "Solution Explorer -> References -> Properties -> Local Copy" of all the files are set to true. I currently build as x86, because if I build as x64 I get this error:
Error NuGet Error: Unable to find version '2.4.8' of package 'OpenCV.overlay-x64_v120_Release'. C:\Users\bla\Desktop\bla\packages\OpenCV.2.4.8\build\native\OpenCV.targets
What could be the issue?
Complete Error:
Fatal @ 9/9/2016 9:18:19 AM - CurrentDomainOnUnhandledException v2.0.1.0 - Exception Info: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'bla.MainWindow' that matches the specified binding constraints threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'bla.bla.bla.dll' or one of its dependencies. The specified module could not be found.
at bla.MainWindow..ctor()
--- End of inner exception stack trace ---
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at bla.App.Main()