C++/CLI dll could not be loaded in WinUI3 app

Ueda Kunio(上田 邦男) 20 Reputation points
2024-01-10T02:35:05.9466667+00:00

When I called (i.e. instanciated) my class object (e.g. MyTest) which is declared as a managed class in my C++/CLI dll, I saw the following error:

System.IO.FileNotFoundException: 'Could not load file or assembly <MyTest>'

I am sure that the C++/CLI dll is located at the same directory as my app exe.

My app is WinUI3 app and uses the C++/CLI dll to use my C++ dll and has been built as unpackaged app because I thought that sandbox limitation might be related if I used packaged version but it doesn't..

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
323 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,537 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ueda Kunio(上田 邦男) 20 Reputation points
    2024-04-10T23:54:42.0066667+00:00

    I have resolved this issue by myself.

    The cause was missing reference of some 3rd party's dll that was refered from my C++ dll and not correctly installed in my PC. (i.e. My CLI dll was no problem but C++ dll was the source of the cause, the error message was output from CLI project, though...)

    I was able to pass the build by coping the missing dll to the same directory as my app exe.

    0 comments No comments