question

RussKelly-7600 avatar image
0 Votes"
RussKelly-7600 asked RLWA32-6355 commented

I have a legacy application built with Visual Studio 2019 that won't run standalone.

The application is a C# solution linked with C++ projects and I suspect this is a sticky point for publishing the application for standalone execution.

As far as I can tell none of the dependencies are missing, but I see the following errors in the Event Viewer:

Application: MyApplication.exe
Framework version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at MyApplication.Array_Unit..ctor()
at MyApplication.Testbench..ctor()
at MyApplication.main()

Faulty application name: MyApplication.exe, version: 1.0.0.0, timestamp: 0xddad1087
Faulty module name: KERNELBASE.DLL, version: 10.0.19041.1645, timestamp 0xdfe831e6
Exception code: 0xe0434352
Fault offset: 0x0012b982
Faulting process id: 0x3634
Faulting application start time:
Faulting application path: C:\Users\NIWC\Desktop\Release\MyApplication.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report id: ab49e8ba-3960-41c1-a178-d5614194a7e9
Faulting package full name:
Faulting package-relative application ID:

I believe this implies a missing DLL or some other file dependency that KERNELBASE.dll is trying to load.

Not sure.

I have tried dependency walker tools but they just list all possible DLL dependencies resulting in a monolithic set of paths that are impossible to check.

Any help would be appreciated.

Thanks!

Russ

vs-generalvs-debuggingvs-setupvs-msbuild
· 40
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Does it run non-standalone?

Check the Array_Unit class. Is it C++ or C#?

Also try compiling the C# projects using 32-bit or 64-bit configuration, or uncheck the "Prefer 32-bit" compiler option.


0 Votes 0 ·

Yes it does run, as long as at least Visual Studio 2019 Community is installed.

The Array_Unit class is C#, which is also what the solution is.

There are three other C++ projects in the solution, with wrapper classes designed to support calls from C#

Russ

0 Votes 0 ·

Hi @RussKelly-7600 , welcome to Microsoft Q&A forum. Could you share the detailed information which was provided in VS Output window(set the output verbosity to Detailed and then build the project) with me to check further?(Tools > Options > Projects and Solutions > Build And Run > MSBuild project build output verbosity > Detailed)

0 Votes 0 ·

Hi Tianyu,

After observing the detailed output of the build I don't think it would be a good idea for me to hand off that output here as the structure of the program is proprietary and it's behavior may be reverse engineered.

Can you tell me what I should be looking for, or if there's some snippet of output that I can provide for you to assist?

Russ

0 Votes 0 ·

Hi Russ, does the output message show which file(s) that cannot be found, and does it show the detailed directory of the missing file(s)? If the error message shows the reasons/details of the error, please let me know.

Regards,
Tianyu

0 Votes 0 ·
Show more comments

1 Answer

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered RLWA32-6355 commented

One way you can end up with this problem is if the C# project reference to the C++ DLL was made by selecting a file using "Browse" instead of selecting the C++ project. If the specific file used to add a reference was a debug version then that is what will be published.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes!

That was the problem. I was looking for the issue in the Property Pages, but what I had done is add a reference in the C# project to the DLL directly, and it was pointing to the one in the Debug directory.

I figured it was probably something simple, but it's finding it that was the problem.

Thanks so much for your patience.

I know you have better things to do that babysit wayward developers.

0 Votes 0 ·

You're welcome.

0 Votes 0 ·