[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Problems with publisher policy file

TJoker.net

10/12/2002 1:16:00 AM

I'm facing and interesting and blocking problem with the publisher policy
file use.

I have three strong named assemblies:
MyCompany.Product1.dll, Version=5.0.0.1, Culture=neutral,
PublicKeyToken=f6815420c0e3f3fc

MyCompany.Product2.dll, Version=5.0.0.1, Culture=neutral,
PublicKeyToken=f6815420c0e3f3fc

MyCompany.Product3.dll, Version=5.0.0.1, Culture=neutral,
PublicKeyToken=f6815420c0e3f3fc

- Product2 only references .NET framework stuff (System.dll, etc)
- Product3 references .Net framework and also Product1


I have all three in the GAC of my server and I'm trying to install version
5.0.0.2 of Product2 and Product3

For Product2, I did as described in the SDK documentation, created the
policy file and the policy assembly:
(policy2.xml)
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyCompany.Product2"
publicKeyToken="f6815420c0e3f3fc" />
<!-- Redirecting to version 5.0.0.2 of the assembly.. -->
<bindingRedirect oldVersion="5.0.0.1"
newVersion="5.0.0.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

al /embed:policy2.xml /out:policy.5.0.MyCompany.Product2.dll
/keyfile:My_keyfile.snk

I installed the policy assembly and the new assembly in the server's GAC and
it worked like a charm, very nice!

BUT ... when I tried the same thing for Product3 (which references another
assembly with the same publicToken name) using a similar policy file and
assembly:

(policy3.xml)
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyCompany.Product3"
publicKeyToken="f6815420c0e3f3fc" />
<!-- Redirecting to version 5.0.0.2 of the assembly.. -->
<bindingRedirect oldVersion="5.0.0.1"
newVersion="5.0.0.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

al /embed:policy2.xml /out:policy.5.0.MyCompany.Product3.dll
/keyfile:My_keyfile.snk

When I ran anu code that tries to load MyCompany.Product3.dll ()version
5.0.0.1 or even 5.0.0.2) I get the following error (PolicyGen.exe is my test
app):

System.IO.FileLoadException: Unable to load file 'MyCompany.Product3'.
The line of code looks like:
string typ = typeof(MyCompany.Product3.SomeClass).FullName;

The fusion log viewer (fuslogvw.exe) gives me the following report:

*** Assembly Binder Log Entry (10/11/2002 @ 5:21:29 PM) ***

The operation failed.
Bind result: hr = 0x80070103. No more data is available.

Assembly manager loaded from:
C:\WINNT\Microsoft.NET\Framework\v1.0.3705\fusion.dll
Running under executable C:\Temp\testCU\new\PolicyGen.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = MyCompany.Product3, Version=5.0.0.2, Culture=neutral,
PublicKeyToken=f6815420c0e3f3fc
(Fully-specified)
LOG: Appbase = C:\Temp\testCU\new\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : PolicyGen, Version=1.0.1014.27978, Culture=neutral,
PublicKeyToken=null.
===

LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
ERR: Failed to apply policy (hr = 0x80070103).
ERR: Unrecoverable error occurred during pre-download check (hr =
0x80070103).

The dll's are still in the same folder as when they were copied to the GAC.

Any clues ??? Am I doing anything wrong? Is this a known issue?

Thanks in advance for any help here!!

--
_________________________________________
TJoker, MCSD
Chicago-based .NET developer
mailto:sergio_pereira@msn.com
-----------------------------------------