Development Environment
Development OS : Windows 8.1 Pro
VS : 2013
App: Winform & WPF
MSSQL : 2012
EF : 6.0
EMGU.CV : 3.0.0
ffmpeg, Nreco, office.interop and several other plugins installed with app.
We have developed a vehicle tracking system with the help of emgu.cv for image processing. we are using capture method to grab images from the input video file and process images. Any way, the application is almost done. To test the application, we are trying it in several machines. Like with different cores / different OS (w7/w8/w8.1/w10) etc.
we are installing MSSQL express 2012, .net fw 4.5, 4.5.1, before using the app in pc's where vs is not installed.
in most of the case, our test pc has VS 2013, and in those pc, there are no problem running this application.
Some pc have adobe products but not VS. But they are running the application too.
But those pc, just have installed or dont have any adobe product or VS, they are crashing at the same point( in 5 pc).
Application: VehicleTrackingSystem.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException
Stack:
at Emgu.CV.CvInvoke.cvReleaseCapture(IntPtr ByRef)
at Emgu.CV.Capture.DisposeObject()
at Emgu.Util.DisposableObject.Dispose(Boolean)
at Emgu.Util.DisposableObject.Finalize()
Same solution is running in several pc as mentioned before. But in some cases, it shows (basically in win 7) System.dllnotfoundexception.
Its assumed that, some dlls are mismatching, may be because of VS installation or adobe product installation. I have tried Dependency Walker but in Positive PC and negetive PC all dll is similar. But the dll's file version is not same though.
how to solve this?
Related
I've been chasing this problem for a few days now. I've developed a .NET 5 solution which works perfectly on my develop laptop. It consists of 3 projects (2 class libraries and a wpf project). Deployment is made via a Visual Studio 2022 installer project.
One of the class libraries references some third-party 64 bit dlls for which I have no control. Deployment target on all projects and installer project is x64 (even the "TargetPlatform" property on the installer project).
The program behaves as expected on Windows 10 Desktop OS (my dev laptop and 2 other co-workers laptops), however, when installing the program on a Windows Server 2019, I get the following exception (with xyz.123.abc being one of the third-party dlls):
System.BadImageFormatException: Could not load file or assembly 'xyz.123.abc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. An attempt was made to load a program with an incorrect format.
Note that the exception message does not include the "or one of its dependencies" part that I've read on other questions.
As I have no direct access to the deployment server, I set up my own Windows Server 2019 instance (with the same conditions as the deployment server) on VirtualBox and was able to reproduce the problem. It also reproduced on a Windows 11 Desktop OS.
The third-party dlls are exposed via the installation of a Program, which for testing purposes I also installed on my VM OS, but still getting the same problem.
I've made sure the .NET 5 desktop runtime is 5.0.17 on both dev, VM and deployment PCs. All environments are 64 bits as well.
As a side note, all other features of my program work as expected on all environments.
1st edit: I was able to reproduce on my dev PC by changing target platform to x86... Expected behavior since the third-party dlls are 64 bit, makes no sense to fail at runtime x64 still.
If anyone runs into this problem, check if your 3rd party dlls rely on VC++ redistributables.
In my case, I was missing VC++ 2013 redist. Which I downloaded from Microsoft directly.
Managed to find out using Dependencies
I am trying to develop a winform application for mobile computers but when I compile project and try to start it on mobile computer, it show a framework error message below.
Which version of microsoft visual studio or framework I need to use.
NOTE: I used visual studio 2010 / 2015 / 2022 and .net framework versions 2.0 and 2.0 < all
Mobile computer uses Windows Operation System
Error Message:
Sayim.exe
MissingMethodException
File or assembly name 'System.Windows.Forms,Version=2.0.0.0., Culture=neutral, PublicKeyToken=B77A5C561934E089', or one of its dependencies, was not found.
Device Information:
Windows Embeded Handheld 6.5 Classic
CE OS 5.2.29344 (Build 29344.5.3.12.401)
Processor: PXA32X-806MHZ
Memory: 232.76 MB
I found a solution:
I installed visual studio 2008 and created a new project as C# smart device and after that selected target platform as windows CE and template device application.
So application works.
I have created a WPF desktop application using the community edition of Visual Studio 2017.
The problem that I am facing is that my application does not run on some PCs where I try to install my application whereas it runs fine on others. On the OCs where it does not work, when I execute my application no errors are thrown but in the task manager the status of my process changes to suspended and then the process is removed from the set of running processes.
I am able to debug and run application on my PC (Win 10 64 bit OS), and on couple of other PCs that have Windows 8 64 bit OS, but the ones on which the application fails to run are Windows 10 PCs, but I am not sure if Win 10 is the problem since the application is running on my PC.
When creating the installer for my application, I have the following options selected:
.Net framework 4.6.1(x86 and x64) as a pre-requisite.
Download prerequisites from the same location as my application.
I need help in debugging what is cause for this problem, since at this point I do not know what is stopping my application from running. How can I debug what is going wrong on these deployment PCs?
I have tried installing on different PCs, but could not identify the reason why it is working on some whereas not on others.
I thought maybe the "Microsoft Visual C++ Redistributable 2017" is a requirement so I downloaded and installed on the client machine but this too did not help.
I also disabled the anti-virus software, but this too did not help.
I have developed a C# Desktop Application application on VS2013 that has CEF(Chrome Embedded Framework) in it. The Application is developed on .NetFramework 4.5.2 with Target Platform set as x64 (It has to be x64 otherwise CEF doesnt work)
The App runs on the developer PC but when i install it (using a setup) on Clients PC and simply run it by clicking the installed .exe , the mouse pointer loads for a few seconds and then nothing happens. It doesn't appear in task Manager either. I have tested it by installing another C# Desktop app developed in the same environment and configuration but without CEF , and it is working Fine in all the client's PC's.. Is there any problem with the CEF?
Following are the Specs of Developers PC and the Clients PC.
Developers PC : [Application Running]
Windows 10
OS = x64 bit
Visual Studio 2013 with .NETFramework 4.5.2
Visual C++ 2012 Redistributable Package
CEF .dll files included and placed in Debug Folder
Another PC 2 : [Application Running]
Windows 7
OS = x64 bit
Visual Studio 2013 with .NETFramework 4.5.2
Visual C++ 2012 Redistributable Package
CEF .dll files included and placed in Debug Folder
Clients PC 1 [Application NOT Running]
Windows 8.1
OS = x64 bit
Visual C++ 2012 Redistributable Package
CEF .dll files included and placed in Debug Folder
Clients PC 2 [Application NOT Running]
Windows 8.1
OS = x64 bit
Visual C++ 2012 Redistributable Package
CEF .dll files included and placed in Debug Folder
Any help would be highly appreciated. Thanks a lot.
There is a tool built into windows called sxstrace.exe that can help determine what is missing.
1) Run something like:
sxstrace trace -logfile:mylog
2) Try to launch the application
3) stop the trace (press any key in cmd window)
4) parse the logfile like:
sxstrace parse -logfile:mylog -outfile:mylog.txt
5) view output file for errors
EDIT: In your case, very likely missing some CEF files. From their documentation:
The following files, in addition to the usual .NET project files,
should be present in the bin directory. They should live side-by-side
in the same directory as the CefSharp.Wpf.Example.exe file, except for
en-US.pak which is in a locales subdirectory:
cef.pak devtools_resources.pak icudt.dat libcef.dll /locales/en-US.pak
I hope you are not releasing a Debug version of your application. That might explain the dependency on MS VS being installed. In my C++ experience debug builds sometimes require some DLLs that can only be found in a Visual Studio installation.
Another debugging idea: download a Sample Application and place just the executable (cefclient.exe) into your project installation. It is important to fetch the version that corresponds to your CEF version. Try to run the simple app. If it works, then the required binary dependencies and assets are there and the problem is somewhere else.
I am experiencing complications when running my application on other PCs.
What can I do in Visual Studio 2012 that can ensure that any PC will run my application without complications?
These are the complications as I know them:
1) On Windows 7, the application will not run
2) On Windows XP, a window pop's up and shows an error stating: "Not a valid Win32 Application.".
My application is a Windows Form built in Visual Studio 2012 using Windows 7. This is my first time building an application for other users.
I found a similar related issue here:
http://blogs.msdn.com/b/vsnetsetup/archive/2012/10/16/setup-exe-is-not-a-valid-win32-application.aspx
However, that did not resolve the error. I've made sure that the Configuration Manager target platform is Any CPU.
Runs okay for me on both a WinXP and Win7 machine with .NET 4.5 installed.
Can you try building against a lower framework version (under the forms project properties, change target framework to 3.5 or 4.0) and retry on the computers that failed? If it then runs correctly, you can either continue building against a lower version or optimally, make sure your installer checks the correct framework version is installed.