Jonathan
Jonathan

Reputation: 7571

sxs manifest doesn't take effect after first time

My application (myapp.exe) needs to use 2 COM objects that can't be loaded at the same time - they have conflicting dependencies in their manifests. So, my plan:

  1. Keep 2 additional copies of the manifest:
    • myapp.exe.manifest.comp1 - references comp1.manifest
    • myapp.exe.manifest.comp2 - references comp2.manifest
  2. Before I run myapp.exe, copy the desired myapp.exe.manifest.comp1/2 to overwrite myapp.exe.manifest.

However, I found that Windows still uses the original myapp.exe.manifest, see Test below. It seems Windows keep some kind manifest cache somewhere?

Question: How can I replace manifests, and get the replaced manifests to take effect?

Test

  1. Copy myapp.exe.manifest.comp1 myapp.exe.manifest
  2. Run myapp.exe
    • Result: myapp.exe.manifest.comp1 takes effect, and comp1 works
  3. Close myapp.exe, and Copy /y myapp.exe.manifest.comp2 myapp.exe.manifest
  4. Run myapp.exe
    • Expected: myapp.exe.manifest.comp2 takes effect, and comp2 works
    • Actual result: myapp.exe.manifest.comp1 still takes effect, and so comp2 doesn't work

Investigation:

Edit: An alternative would be to:

Upvotes: 2

Views: 56

Answers (0)

Related Questions