I am currently working on a C # WPF project that uses the MySQL.Data and System.Data.Sqlite dll, as well as a couple of others.
The project is a .Net 4 project that works without problems on my development machine. I create an MSI installer package, and when I add the executable, Visual Studio processes the dependencies and adds the required DLL with the EXE.
When I run the installer on my development machine, everything works fine. However, when I copy the installer to an empty virtual machine with the installers .Net Framework 3.5 and .Net Framework 4 installed, the installer says that everything is installed successfully, when I look in the folder with the program files, all the DLLs are there, but when I try run software that the software does not load, and an .Net Runtime error is displayed in the event viewer.
The following error
Application: MySQLBackup.exe Framework Version: v4.0.30319 Description: The process was aborted due to an unhandled exception. Exception Information: System.IO.FileLoadException Stack: at MySQLBackup.App.Application_Startup (System.Object, System.Windows.StartupEventArgs) in System.Windows.Application.OnStartup (System.Windows.StartupEventArgs) in System.Windows.Application. <.ctor> b__1 (System.Object) in System.Windows.Threading.ExceptionWrapper.InternalRealCall (System.Delegate, System.Object, Int32) in MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen (System.Object, System.Delegate, System.Object, Int32, System.Delegate) in System.Windows.Threading.DispatcherOperation.InvokeImpl () at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext (System.Object) in System.Threading.ExecutionContext.runTryCode (System.Obb in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode, CleanupCode, System.Object) in System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext. System.Threading.ContextCallback. System.OreadContextCallback. System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) in System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) in System.Windows.Threading. DispatcherOperation.Invoke () at System.Windows.Threading.Dispatcher.ProcessQueue () in System.Windows.Threading.Dispatcher.WndProcHook (IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) in MS.Win32.HwndWrapper.WrcPro Int32, IntPtr, IntPtr, Boolean ByRef) in MS.Win32.HwndSubclass.DispatcherCallbackOperation (System.Object) in System.Windows.Threading.ExceptionWrapper.InternalRealCall (System.Delegate, System.Object, Int32) on MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen (System.Object, System.Delegate, System.Object, Int32, System.Delegate) in System. Windows.Threading.Dispatcher.InvokeImpl (System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) on MS.Win32.HwndSubclass.SubclassWndProc (IntPtr, Int32, IntPtr, IntPtr) Win32.UnsafeNativeMethods.DispatchMessage (System.Windows.Interop.MSG ByRef) in System.Windows.Threading.Dispatcher.PushFrameImpl (System.Windows.Threading.DispatcherFrame) in System.Windows.Threading.Dispatcher.PushFrame (System.Windows.Threading .DispatcherFrame) in System.Windows.Threading.Dispatcher.Run () at System.Windows.Application.RunDispatcher (System.Object) in System.Windows.Application.RunInternal (System.Windows.Window) in System.Windows.Application.Run (System.Windows.Window) in System.Windows.Application.Run () in MySQLBackup.App.Main ()
, , try catch catch, . , InitialiseComponent(), , , catch , , .
, , .
, , .