I'm developing a simple installer using WiX
on which I'm trying to install a .dll and a publisher policy on GAC.
I successfully add the .dll on GAC using the installer. But I want to use PostBuild events from Visual Studio to execute msbuild commands. The order of the things I need to do is:
Create the publisher policy
on a Post build event of Visual Studio.
Execute the command al /link:the.config /out:the.policy.dll /keyfile:thekey.snk /platform:x86
Publish the policy using a specific GACUTIL.
If I'm correct, if I execute gacutil -i Policy.1.0.TestLibrary.dll
, Visual Studio will install this policy on the new GAC1, and I want to use the older one2.
How can I tell Visual Studio to use a specific gacutil on a Post Build event?
I tried this for PostBuild events:
al /link:"$(SolutionDir)"TestLibrary.dll.config /out:"$(SolutionDir)"Policy.1.0.TestLibrary.dll /keyfile:"$(SolutionDir)"sgKey.snk /platform:x86
But get The command "...." exited with code 9009.
Also, if I publish Library.v1.0.dll on the old GAC, and then I install Library.v2.0.dll on the new GAC, if I create a publisher policy from v1.0 to v2.0, will they find each other?
[1]: GAC used for .Net Framework 4.0 and above.
[2]: GAC used for .Net Framework 3.5 and below.
The problem was solved. There was an inconsistency on the policy, and that's why it wasn't working...