Hello,
I have been struggling with this for a while and I am running out of ideas… so I have decided to ask for your help!
I made a VSTO application. I cannot add LexActivator.dll and LexActivator64.dll as reference as I get an error message stating that these are not valid assemblies or COM components. Fair enough, I added them as data files to the project with build action “content” and copy to output directory “always”.
When publishing with Visual Studio 2015 everything works like a charm. The application installs properly without any issue on client computers. I can use Cryptlex and activate my product without any issues.
The manifest looks like this:
uS1GU0lCDwFWtlvGhEMQyTXnJCQ4EZOFNfKMGh4v5hI= gkQEioLgyK9c4ykkV4qM5rjeQq/2oCfJJwVjOv4kgog=The thing is that I want to copy additional files during deployment or maybe just run a bit of code with a form, I never reached that point anyway so this is not important at this stage. I followed this procedure (https://msdn.microsoft.com/en-us/library/office/ff961899(v=office.14).aspx) and added the following xml to my manifest:
vstav3:postActions
vstav3:postAction
<vstav3:entryPoint class=“PostDeploymentAction.PostDeploymentAction”>
</vstav3:entryPoint>
vstav3:postActionData
</vstav3:postActionData>
</vstav3:postAction>
</vstav3:postActions>
Then I re-sign my deployment manifest and my application manifest with some mage.exe command lines.
When I run the setup on the client computer I get the following error:
“There was an error during installation.”
System.BadImageFormatException: Could not load file or assembly ‘file:///C:\Users\ico\AppData\Local\Apps\2.0\MQ9PK6G1.CPA\VX5YPVPN.LB3
zrb…vsto_6f3973f70f377867_0000.0003_5e8192b4f3158394\LexActivator.dll’ or one of its dependencies. The module was expected to contain an assembly manifest.
Indeed in that folder there are no manifests for those files unlike the other ones but the thing is that if I look into that folder when I don’t include my Post Deployment xml into my manifest, there are no manifest either… So I can assume these files are not supposed to have manifests anyway.
I have tried to completely remove the references to those files in the manifest. The VSTO installs correctly and my post deployment action message box pops-up. When I run the app then of course it crashed cause the two dlls are missing. If I add them manually into the deployment folder, ClickOnce is not fooled and displays the same error message: “The module was expected to contain an assembly manifest.”
I also tried to force it to recognize the files as data with adding this to the manifest:
…
The files were not copied to the deployment folder so I had to copy them manually but same error message when I run the app.
To sum up, everything works fine with those dll without Post Deployment Action. If I add PDA to the manifest and re-sign it, ClickOnce flags those dll as dependencies instead of data files and then look for a manifest which does not exist… Any ideas what I should try next?
Thank you for your help.