Wrong .Net version runtime Assembly Manager launched in VBAScript
-
I've .Net v1.1.4322 and .Net v2.0.50727 both installed on my machine. I've a Excel hosted VBA Script test harness. It makes calls to .Net v2.0.50727 assemblies through COM callable wrapper (CCW). But I found during running this Excel test script, the wrong version of .Net runtime enviroment triggerred! It's supposed that the .Net v2.0.50727 runtime would be launched to run, not the .Net v1.1.4322. All the assemblies called by the script are developed in .Net v2.0.50727. The below message was extrated from the Assembly Binding Log Viewer (Fuslogvw.exe). As we can see, the v1.1.4322 fusion.dll was loaded instead of v2.0.50727 fusion.dll. But SG.AG.Qt.Act.Client.Streams.dll and all other assemblies are developed in .Net v2.0.50727. So it crashed. Would anyone know why Windows chose .Net v1.1.4322 rather than v2.0.50727 to run my script? How can I indicate Windows to choose v2.0.50727 correctly? Thanks so much.
*** Assembly Binder Log Entry (6/29/2007 @ 3:18:58 PM) ***
The operation failed.
Bind result: hr = 0x80131107. No description available.Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE
--- A detailed error log follows.=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Appbase = C:\Program Files\Microsoft Office\OFFICE11\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).LOG: Processing DEVPATH.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll.
LOG: Assembly download was successful. Attempting setup of file: C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131107).
ERR: Failed to complete setup of assembly (hr = 0x80131107). Probing terminated. -
I've .Net v1.1.4322 and .Net v2.0.50727 both installed on my machine. I've a Excel hosted VBA Script test harness. It makes calls to .Net v2.0.50727 assemblies through COM callable wrapper (CCW). But I found during running this Excel test script, the wrong version of .Net runtime enviroment triggerred! It's supposed that the .Net v2.0.50727 runtime would be launched to run, not the .Net v1.1.4322. All the assemblies called by the script are developed in .Net v2.0.50727. The below message was extrated from the Assembly Binding Log Viewer (Fuslogvw.exe). As we can see, the v1.1.4322 fusion.dll was loaded instead of v2.0.50727 fusion.dll. But SG.AG.Qt.Act.Client.Streams.dll and all other assemblies are developed in .Net v2.0.50727. So it crashed. Would anyone know why Windows chose .Net v1.1.4322 rather than v2.0.50727 to run my script? How can I indicate Windows to choose v2.0.50727 correctly? Thanks so much.
*** Assembly Binder Log Entry (6/29/2007 @ 3:18:58 PM) ***
The operation failed.
Bind result: hr = 0x80131107. No description available.Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE
--- A detailed error log follows.=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Appbase = C:\Program Files\Microsoft Office\OFFICE11\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).LOG: Processing DEVPATH.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll.
LOG: Assembly download was successful. Attempting setup of file: C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131107).
ERR: Failed to complete setup of assembly (hr = 0x80131107). Probing terminated. -
Have a little patience man. You've got a problem that is not easily solved and takes some research. Open RegEdit, then open HKEY_CLASSES_ROOT, then find the CLSID folder, then the GUID for your class. You can also click on the CLSID folder and then search the values for your class name. Open the GUID for your class, then open teh InProcServer32 folder in there. In there, you should find a RuntimeVersion value that should read "v2.0.50727". If it doesn't have this value, this might be your problem. You might also want to look at this[^] MS KB article. There's a bug in Office when hosting .NET 2.0 components...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Have a little patience man. You've got a problem that is not easily solved and takes some research. Open RegEdit, then open HKEY_CLASSES_ROOT, then find the CLSID folder, then the GUID for your class. You can also click on the CLSID folder and then search the values for your class name. Open the GUID for your class, then open teh InProcServer32 folder in there. In there, you should find a RuntimeVersion value that should read "v2.0.50727". If it doesn't have this value, this might be your problem. You might also want to look at this[^] MS KB article. There's a bug in Office when hosting .NET 2.0 components...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007