G
Gerhardo
Hi,
We had a strange issue using Word. We wrote an add-in for Office 11. The
add-in makes a call to a COM object implemented in .Net version 2.X. The
assembly was registered with regasm and the codebase switch. It was not part
of the GAC. We could create a little VB script or a VB 6 app and perform a
createobject(MyNet.Component) without any trouble. When we tried to do the
same thing from VBA code in Word, however, it failed to load the assembly.
It turns out that Word ended up trying to load the assembly with an earlier
version. of .Net on some machines. There was no winword.exe.config file
present instructing Word to do so. I assumed that by default, it would always
try to use the most recent version of the framework. I fixed it by putting
such a config file into the Office11 directory. Now we can create the object
just fine.
I'd like to know what made Word determine to use the older version of the
framework? As far as I know, it would use the most recent one in the absence
of a winword.exe.config instructing it otherwise. That did not appear to be
the case on some machines.
Is there a Word specific setting somewhere (I saw nothing with RegMon)? The
only other scenario is that some add-in was loaded which referenced code in
an earlier version of .Net and thus ended up loading the earlier version by
default.
We had a strange issue using Word. We wrote an add-in for Office 11. The
add-in makes a call to a COM object implemented in .Net version 2.X. The
assembly was registered with regasm and the codebase switch. It was not part
of the GAC. We could create a little VB script or a VB 6 app and perform a
createobject(MyNet.Component) without any trouble. When we tried to do the
same thing from VBA code in Word, however, it failed to load the assembly.
It turns out that Word ended up trying to load the assembly with an earlier
version. of .Net on some machines. There was no winword.exe.config file
present instructing Word to do so. I assumed that by default, it would always
try to use the most recent version of the framework. I fixed it by putting
such a config file into the Office11 directory. Now we can create the object
just fine.
I'd like to know what made Word determine to use the older version of the
framework? As far as I know, it would use the most recent one in the absence
of a winword.exe.config instructing it otherwise. That did not appear to be
the case on some machines.
Is there a Word specific setting somewhere (I saw nothing with RegMon)? The
only other scenario is that some add-in was loaded which referenced code in
an earlier version of .Net and thus ended up loading the earlier version by
default.