Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Publisher Policy

Status
Not open for further replies.

BKQc

Programmer
Jul 26, 2002
118
CA
I built a shared assembly that is distributed in GAC and I had to do a patch to it. The old version was 1.5.0.5 and the new ons is 1.5.0.6.

I followed the instructions here:
and successfully added the policy assembly to the GAC BUT, it seems that the policy isn't applied since when I use my test application, it states 1.5.0.5 on
[type].assembly.GetName().GetVersion().toString()

My policy assembly is called
Policy.1.5.BaseAssemblyName.dll
the config file is called
Policy.1.5.BaseAssemblyName.config
and versionned 1.5.0.6

If I look in the assembly/GAC/Policy.1.5.BaseAssemblyName/1.5.0.6__* folder, both the .dll and .config files are there (with __AssemblyInfo__.ini)

I have reasons to think that the binding process looks to it since my test app crashes if I remove the .config file.

Finally, I tried using fuslogvw.exe to know what is going on but nothing gets logged into it.

Any help will be greatly appreciated!

P.S. Here is the content of the config file:
<configuration>
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="BaseAssemblyName" publicKeyToken="5deba177a812746c" />
<bindingRedirect oldVersion="1.5.0.5" newVersion="1.5.0.6" />
<!--codeBase version="2.0.0.0" href=" </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>





[Burger King stole my nick!]
 
I did a new test:
I tried modifying the XML in the .config file to make it a not well-formed XML and then ran the test app: no crash!

My conclusion on this: .NET doesn't seem to use the config file even though it does need it.

And to verify that it's not because the file is being registered as part of the assembly, I tried to simply don't link it to the assembly and redeploy in the GAC. Result: app crash!

Still searching...
 
I don't think that dll files use config files, only exe files do.
 
I finally got it to work.
The first time, the problem came from the fact that my config file wasn't correctly added to the assembly (/embed instead of /link) and when I did it correctly, I had changed the XML inside the config file and an error was introduced in it.

The way I corrected it was to use fuslogvw but I had to set a value in the registry (I'm using .NET 1.1). The keys to set is in
HKLM/SOFTWARE/Microsoft/Fusion
and is
ForceLog [REG_DWORD] = 1
What this does is log ALL fusion event that occur in the system. For more information on fuslogvw and other fusion stuff, take a look here:

The error I got was
ERR: There was an error parsing XML (hr = 0xc00ce509).
WRN: Error parsing XML file C:\WINNT\assembly\GAC\policy.1.5.P8DIW2_LLMRQ\1.5.0.6__5deba177a812746c\Policy.1.5.P8DIW2_LLMRQ.config. Ignoring.
and to correct it, I used XMLSpy to validate the document.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top