I have .NET framework assembly which is exposed to COM. Recently, since the assembly minor version number reach 10, it stopped being usable from Windows Script Host (WSH).
[assembly: AssemblyVersion("1.10.0.0")]
The TypeLib
registry entry for some obscure reason uses hexadecimal notation, when storing the version number:
BUG: The Regasm Tool Registers the Type Library with the Decimal Value Instead of the Hexadecimal Value
In this case it would be 1.a
:
[HKEY_CLASSES_ROOT\TypeLib\{D766F0C8-9968-4A72-B918-D2780AEE7399}\1.a]
@="myassembly"
When the assembly is referenced in WSF file, WSH/cscript
breaks whenever a
–f
"digits" are present in the version number. So it works for 1.0
or 1.9
, does not work for 1.10
(1.a
) or 1.15
(1.f
), but works again for 1.16
(1.10
) or 1.25
(1.19
), and does not work again for 1.26
(1.1a
) (I didn't check all intermediate values, but the pattern seems to be clear).
<job>
<reference object="myassembly.Class1" />
<script language="JScript">
...
</script>
</job>
The cscript
says:
Windows Script Host: Cannot add reference : {D766F0C8-9968-4A72-B918-D2780AEE7399}
It seems like a bug in the WSH/cscript
to me. Or am I missing something?