Tuesday, February 3, 2009

Subtleties of Publisher Policy files. AL linked vs. embeded, etc.[DRAFT]

My stubborn belief in the better world led me into using AL.exe for generating publisher policy assemblies with embed and not linked option.

Silly me! Being not alone (http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1f86f274-f75c-430a-aaf5-96ddf465a86a/, http://bytes.com/groups/net-c/273086-publisher-policy-net-2-0-a) and after loosing an hour or so trying to troubleshoot, I ran into this (see comments to the entry):  http://blogs.msdn.com/junfeng/archive/2005/05/24/421459.aspx

Ok, so the only option is really to use the linked option, that means that you should provide the policy config file to the release team alongside publisher policy dlls.

Here is some log of my further discoveries once I got policy working:

1. You can drop policy directly to the gac assembly folder, given the policy xml file is present in the folder you drop it from. Otherwise (including case of gacutil /i) you'll be rewarded by the:
A module specified in the manifest of assembly 'policy.X.Y.SampleLibrary.dll' could not be found.

2. I have not tested for myself yet, but given the structure of a GAC:


And the fact that mine AnyCPU assembly and policy ended up in the GAC_MSIL, I sincerely believe that I'll have to have policies per assembly/platform. Quite certain, but subject to verify soon.


The best for Fusion: http://www.grimes.demon.co.uk/workshops/fusionWS.htm

Creating publisher policy: http://msdn.microsoft.com/en-us/library/dz32563a(VS.71).aspx
Redirecting assembly versions: http://msdn.microsoft.com/en-us/library/7wd6ex19(VS.71).aspx
Alan Shi's Fusion blog: http://blogs.msdn.com/alanshi/

Post a Comment