I've followed Microsoft's docs about manifests and wanted to use one in my application https://learn.microsoft.com/en-us/cpp/build/how-to-embed-a-manifest-inside-a-c-cpp-application?view=msvc-170
I'm using CMake as my build system for a graphics engine,
I have a target A
linking my assembly manifest
, let's call it test.manifest
(and a dynamic library Test_debug
) specified in sources list when creating this target (CMake allows to handle any *.manifest
files this way)
add_executable(A main.cpp <path>/test.manifest)
the test.manifest
looks following
<assembly manifestVersion="1.0">
<assemblyIdentity type="Win32" name="MyCompany.Windows.Test" version="1.0.0.0" publicKeyToken="0000000000000000" />
<file name="Test_debug.dll"/>
</assembly>
my target A
needs to load the Test_debug.dll
and this library should be located given assembly directory thanks to application assembly manifest
the Test_debug.dll
is located at path x/y/z/Test_debug.dll
, the assembly manifest
is located at x/y/z/test.manifest/test.manifest
my target A
that links imported library Test_debug.lib
therefore needs Test_debug.dll
has following pragma in it's source cpp code
#pragma comment(linker, "/manifestdependency:\"name='MyCompany.Windows.Test' "\
"version='1.0.0.0' "\
"type='Win32'\"")
but for some reason when I try to launch target A
executable I get this message from Event Viewer
Activation context generation failed for "an_absolute_path\bin\A.exe". Dependent Assembly MyCompany.Windows.Test,type="Win32",version="1.0.0.0" could not be found. Please use sxstrace.exe for detailed diagnosis.
and this when it tries to execute A
exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail
if I get this correctly having my assembly manifest located close to Test_debug.dll
should make this directory an assembly and make my Test_debug.dll
findable, but I'm not sure and seems like I'm missing something