Application run - The process was terminated due to an unhandled exception. System.IO.FileNotFoundException

Feichtinger, Frantisek 21 Reputation points
2022-08-17T13:52:47.257+00:00

We have an WinForms application published by click-once.
When starting the application we get these two errors from the win logs.

.net version 4.8 is installed on the machine
OS: Windows Server 2019 Standard
the machine is up-to-date

Please can someone help me with whether this is an issue with .net installation?

Source: .NET Runtime
Event ID: 1026
Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at MyApp.Program.Main()

Source: Application Error
Event ID: 1000
Faulting application name: MyApp.exe, version: 1.0.0.0, time stamp: 0x62fcbd25
Faulting module name: KERNELBASE.dll, version: 10.0.17763.3287, time stamp: 0xd3d15282
Exception code: 0xe0434352
Fault offset: 0x00123f12
Faulting process id: 0x234
Faulting application start time: 0x01d8b23a7b10012a
Faulting application path: C:\Users\AppData\Local\Apps...\MyApp.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: ...
Faulting package full name:
Faulting package-relative application ID:

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,457 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,239 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2022-08-18T07:23:30.06+00:00

    Hello,

    I hate to point out the obvious, but System.IO.FileNotFoundException means the program did not find the file you specified. So what you need to do is check what file your code is looking for in production.

    To see what file your program is looking for in production (look at the FileName property of the exception), try these techniques:

    Then look at the file system on the machine and see if the file exists. Most likely the case is that it doesn't exist.

    Bear in mind that some applications don't use the latest .NET distribution, but updates of the 3.5, 2.0... so you might want to contact the WinForm application manufacturer in order to retrieve the per-requisites for running the application.

    ------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments