Publisher policies sound just like what I need but I just can't get these
things to work. There are several good kb articles that seem to show exactly
what needs to be done....
Here is my publisher file:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<dependentAssem bly>
<assemblyIdenti ty name="JusticeLi nk"
publicKeyToken= "6db63116f81a44 45"
culture="neutra l" />
<!-- Redirecting to version 3.3.0.0 of the assembly. -->
<bindingRedirec t oldVersion="3.3 .0.0"
newVersion="3.4 .0.0"/>
</dependentAssemb ly>
</assemblyBinding >
</runtime>
</configuration>
Here is the assembly linker statement:
REM --- Link Policy
al /link:Publisher. config /out:Policy.3.3. JusticeLink.dll
/Keyfile:\Code3\ NorSoftKey.snk /version:3.4.0.0
I previously created a small test app using version 3.3.0.0 and it works.
I installed the policy in the GAC ==>gacutil /i policy.3.3.Just iceLink.dll
then I removed the 3.3.0.0 version and installed the 3.4.0.0 version.
Now the test app no longer works and I get a long error:
LOG: User = NORSOFT\SNORBER G
LOG: DisplayName = JusticeLink, Version=3.3.0.0 , Culture=neutral ,
PublicKeyToken= 6bd63116f81a444 5
(Fully-specified)
LOG: Appbase = file:///C:/Code3/bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : TestPolicy32, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\Windows\Micr osoft.NET\Frame work64\v2.0.507 27\config\machi ne.config.
LOG: Publisher policy file is found at
C:\Windows\asse mbly\GAC_MSIL\P olicy.3.3.Justi ceLink\3.4.0.0_ _6bd63116f81a44 45\Publisher.co nfig.
LOG: Post-policy reference: JusticeLink, Version=3.3.0.0 , Culture=neutral ,
PublicKeyToken= 6bd63116f81a444 5
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Code3/bin/JusticeLink.DLL .
LOG: Assembly download was successful. Attempting setup of file:
C:\Code3\bin\Ju sticeLink.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: JusticeLink, Version=3.4.0.0 , Culture=neutral ,
PublicKeyToken= 6bd63116f81a444 5
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.
=============== ===========
A couple of things I noticed is when I install the new policy in the GAC the
version is 0.0.0.0, so I put the version option in the assembly linker for
3.4.0.0. None of the kb articles I saw used that /version option so I am
guessing this has something to do with it.
This is on a vista64/ultimate system using VS2008. All programs are C# as
ANY CPU. Culture and options all seem to match up.
So I am at a loss. Any ideas?
--
Scott Norberg