Wpf exe file crashes after deployment - c#

My wpf application uses Windows.winmd and System.Windows.Runtime dll, and I have been trying to deploy the application using Visual studio setup installer project.
When I tried to build the setup project it would silently fail and show this non-descriptive error:
ERROR: An error occurred while validating. HRESULT = '80070057
taking help from this link: Could not load file or assembly Windows.winmd' I learned that when winmd files are referenced in a wpf application than files need to be manually added to the 'Application Folder', I did so, after manually adding the .exe file it added the dlls to the Application Folder, now I can build the setup project but it still shows these following warnings:
WARNING: Unable to find dependency 'WINDOWS' (Signature='(null)' Version='255.255.255.255') of assembly 'System.Runtime.WindowsRuntime.dll'
WARNING: Unable to find dependency 'MATERIALDESIGNCOLORS' (Signature='(null)' Version='2.5.0.1205') of assembly 'MaterialDesignThemes.Wpf.DLL'
WARNING: Unable to find dependency 'WINDOWS' (Signature='(null)' Version='255.255.255.255') of assembly 'Scout_Windows.exe'
Am I adding the files the wrong?
After installing the application from the generated setup.msi file, when I launch the .exe file, it doesn't start. The event viewer shows two errors, Application error:
Faulting application name: Scout_Windows.exe, version: 1.0.0.0, time stamp: 0xaf6df283
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x015909b0
Faulting process ID: 0x2f58
Faulting application start time: 0x01d4907c33342151
Faulting application path: D:\temp\scout\Scout_Windows.exe
Faulting module path: unknown
Report ID: d0cf8414-8f12-4166-8836-ba1ec5ca8c80
Faulting package full name:
Faulting package-relative application ID:
.Net Runtime error:
Application: Scout_Windows.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at Scout_Windows.App..ctor()
at Scout_Windows.App.Main()
here is snapshot for the contents of my Application Folder in the setup project
I have spent two days on this error! any help is appreciated.

Related

BadImageFormatException is thrown after a few days

I've gone through several posts about BadImageFormatException but I couldn't find answer to my situation.
I've a C# project that uses few 3rd party DLLs. The project's runtime is .NET Framework 4.8. I build the project using "Any CPU" configuration in VS 2022. An installer is built and the software is distributed through the installer.
On the end user's Windows 10 x64 machine, the software runs fine for a few days. After that suddenly the software stops launching. When tried to launch, Windows generates the following event logs:
Application: <application name>.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.BadImageFormatException
and
Faulting application name: <application name>.exe, version: 1.0.0.0, time stamp: 0x6215bc3a
Faulting module name: KERNELBASE.dll, version: 10.0.18362.535, time stamp: 0x5bd9df62
Exception code: 0xe0434352
Fault offset: 0x001135d2
Faulting process id: 0x610
Faulting application start time: 0x01d82c9bac0533c9
Faulting application path: C:\Program Files (x86)\<application path>
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 0c7bbce1-7a2b-47f5-a95a-083860aad054
Faulting package full name:
Faulting package-relative application ID:
Surprisingly, replacing the .exe file with the original .exe file solves the problem and makes the software starts again.
What could be the possible reason for this? How to fix it?
I've checked all of the 3rd party DLLs with file command that all of them are built as 32 bit DLL.

ArcGIS Runtime: application crash when changing parent of MapView

I'm developing with ArcGIS Runtime SDK for dotNet 10.2.6.
(Environment: Win7 64bit, .net 4.5.2, compiled for x86, WPF project)
When I change the parent element (e.g. Grid) of the MapView in my project, the application sometimes just crashes with no exception or message.
This happens after just a few switches between parents.
Is this a known bug ? Any workaround ?
This is the error I see in the Windows Event Viewer:
Faulting module name: MSVCR120.dll, version: 12.0.21005.1, time stamp: 0x524f7ce6
Exception code: 0xc0000005
Fault offset: 0x00011703
Faulting process id: 0x1ac4
Faulting application start time: 0x01d147a199237ca7
Faulting module path: C:\Program Files (x86)\ArcGIS SDKs\DotNet10.2.6\WindowsDesktop\bin\arcgisruntime10.2.6\client32\MSVCR120.dll

NReco PDFGenerator issue

I've been using this tool for about a week, and now, today, it just stopped working. I've reverted the rest of my code back to the previous state and I keep getting the same error.
All that I'm getting from the Exception that is thrown is:
An exception of type 'System.Exception' occurred in NReco.PdfGenerator.dll but was not handled in user code
Additional information: Cannot generate PDF: (exit code: -1073740791)
From the Windows Event Log:
Faulting application name: wkhtmltopdf.exe, version: 0.12.2.1, time stamp: 0x54bd0265
Faulting module name: MSVCR120.dll, version: 12.0.21005.1, time stamp: 0x524f7ce6
Exception code: 0xc0000409
Fault offset: 0x000a7666
Faulting process id: 0xc8c
Faulting application start time: 0x01d0deb1a8d73b2f
Faulting application path: C:*****\bin\wkhtmltopdf.exe
Faulting module path: C:\Windows\SYSTEM32\MSVCR120.dll
Report Id: e8c8bcf0-4aa4-11e5-826d-acb57d145db6
Faulting package full name:
Faulting package-relative application ID:
Any ideas what could be causing this?
The reason of this error is not in your code: it seems something changed in your environment and wkhtmltopdf.exe stops working because of missed VC++ 2013 runtime libraries (required for latest v.0.12.2.1).
You can download and install them from Windows Downloads: Visual C++ Redistributable Packages for Visual Studio 2013
PdfGenerator embeds x86 build of wkhtmltopdf and you may install only x86-version of redistributable package ( vcredist_x86.exe ).
--- update ---
For latest wkhtmltopdf 0.12.4 VC++ 2015 runtime libs are needed.

application.exe.config file issue when installing on a clean machine

I have created an installer project in WPF. when I run the application on my computer, it works fine. I set a minimum requirement for the .net framework 4.5. But if I run the application on another machine (with newly installed windows 7), the application crashes.
Below is event viewer log:
Installer exception
Faulting application name: MyInstaller.exe, version: 1.0.0.0, time stamp: 0x55572605
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17514, time stamp: 0x4ce7bafa
Exception code: 0xe0434352
Fault offset: 0x0000b727
Faulting process id: 0x398
Faulting application start time: 0x01d08fca117f3e62
Faulting application path: C:\Users\self\Downloads\MyInstaller.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 517dc0dd-fbbd-11e4-a332-b083fe4d72a6
Application: MyInstaller.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at MyInstaller.App.Main(System.String[])
I tried to create "Window event log" inside Main() try-catch method, but the application was not able to reach to that point.
When I send myinstaller.config.exe file with project exe file in the new installed machine, then it shows error. That the application does not meet requirement.
In my machine myinstaller.config.exe is not requirement, even after I uninstall framework 4.5 and 4.0.

Unhandled exception for the component "MultiScaleImage" of "Silverlight 5"

I am developing a web application based on "Silverlight 5".
I found a blocking bug related to the component "MultiScaleImage" that happens after a unpredictable (sometimes it takes hours, sometimes minutes) number of zooms of the image.
When the issue occurs the following messages are shown:
Windows 7 Event Log: Faulting application name: IEXPLORE.EXE, version: 11.0.9600.17126, time stamp: 0x53882e30
Faulting module name: agcore.dll, version: 5.1.30214.0, time stamp: 0x52fdb3c4
Exception code: 0xc0000005
Fault offset: 0x003a8d0d
Faulting process id: 0x18dc
Faulting application start time: 0x01cf9cf438322755
Faulting application path: C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE
Faulting module path: C:\Program Files (x86)\Microsoft Silverlight\5.1.30214.0\agcore.dll
Report Id: a9de107e-08fe-11e4-b5ce-c86000a4b136)
Visual Studio Debugger: Unhandled exception at 0x5CCD8D0D (agcore.dll) in iexplore.exe: 0xC0000005: Access violation reading location 0xFFE2E6F2.
Internet Explorer 11: Internet Explorer has stopped working.
The test has been done with Win7+SP1 with IE11 and IE8.
This bug is preventing me from releasing the application and deploying it to the customer servers.
I can't believe there's no way to solve it nor a valid workaround.

Categories

Resources