IIS 6.0 generates eTag values in the format "hash: changenumber". The changing number increases every time IIS is reset, so your eTag is only valid for the life of your IIS process. Restart, number increases, hash: changenumber! = Hash: changenumber + 1.
Fix this to hard-code the changenumber , which is possible with Metabase Explorer, the .NET utility for editing the metabase, or by editing the XML file when IIS is stopped.
I want to do this programmatically, with the server running, for example, I can set all other metabase properties using ADSI or WMI. This is not possible for this, since the property (which is only internally called MD_ETAG_CHANGENUMBER) does not seem to have a corresponding property name.
Here is an example of a problem in VBScript:
set obj=GetObject("IIS://localhost/W3svc")
WScript.Echo "Log type: " & obj.LogType
WScript.Echo "Change number: " & obj.MD_ETAG_CHANGENUMBER
Exit:
Log type: 1
etag.vbs(3, 1) Microsoft VBScript runtime error: Object doesn't support this property or method: 'obj.MD_ETAG_CHANGENUMBER'
I want to be able to set this value in C #. If you don't stop IIS by setting the value in XML and running it again, is there a way to program this value programmatically?
My best thought: (ab) to use the IISMbLib.dll that comes with Metabase Explorer, so if anyone has experience using this, I would love to hear it.
Literature: