none
Publisher policy file RRS feed

  • Question

  • I want to bind earlier versions of an assembly to our latest version via publisher policy file.  No problem getting this to work in my dev environment simply by following the instructions here:

    http://msdn.microsoft.com/en-us/library/dz32563a.aspx

    Unfortunately, this is giving our InstallShield person headaches because the policy config file and policy assembly are separate files. The instructions state the publisher policy assembly cannot be added to the global assembly cache unless the original publisher policy file is located in the same directory as the assembly.

    According to our InstallShield person, he just tells InstallShield whether an assembly should be GAC'd or not, and it automagically does it for you at install time.  However, there's no (obvious) way to effect having this policy file in the same location as the assembly at the time it is GAC'd.   (We're not sure where InstallShield copies the assembly before it GACs it).

    Anybody conquered this problem already?  Is there a way to embed the policy config file inside the policy assembly, or does it HAVE to be a separate file?

     

     


    • Edited by nrcaliendo Wednesday, November 2, 2011 4:07 PM
    Wednesday, November 2, 2011 4:06 PM

Answers

  • It says "The publisher policy assembly cannot be added to the global assembly cache unless the original publisher policy file is located in the same directory as the assembly.". That means if you want to install the publisher policy assembly to GAC, it is necessary to place original publisher policy file in the same directory as the assembly.
    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Zhou Wednesday, November 16, 2011 3:59 AM
    Monday, November 7, 2011 5:41 AM

All replies

  • Ok, thanks for your response.
    Thursday, November 3, 2011 12:36 PM
  • See this link:

    http://msdn.microsoft.com/en-us/library/dz32563a.aspx 

    The assembly linker program (al.exe) creates an assembly from the config file. There's an example command line:

    al /link:pub.config /out:policy.1.0.myAssembly.dll /keyfile:sgKey.snk /platform:x86

    Once you've done that the config file is in the resources of the policy assembly so it doesn't need to be separately installed.

     


    Phil Wilson
    Thursday, November 3, 2011 8:19 PM
  • That's what I originally thought, but that does not appear to be the case.  I used the same command line in the example (and in your post).  However, it did not work unless the policy config file was present in the same directory as the policy assembly when I GAC'd it.  I get the following error:

    Failure adding assembly to the cache: One or more modules specified in the manifest not found.

     

    Thursday, November 3, 2011 8:55 PM
  • I think that means there's a mismatch somewhere between the name of the config file and the assembly. I vaguely remember that that the installer is picky about that. So it looks at the assemlbly and it's happy if it finds the config info in the resources with the name it wants. If you use NET Reflector on the policy assembly you should see the config file in Resources, and if you do then it's this name mismatch.
    Phil Wilson
    Saturday, November 5, 2011 5:35 PM
  • It says "The publisher policy assembly cannot be added to the global assembly cache unless the original publisher policy file is located in the same directory as the assembly.". That means if you want to install the publisher policy assembly to GAC, it is necessary to place original publisher policy file in the same directory as the assembly.
    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Zhou Wednesday, November 16, 2011 3:59 AM
    Monday, November 7, 2011 5:41 AM