Hi all,
 
I'm building an installer for a .NET 1.1 application which uses COM+, but 
having an issue with the way the ComPlusExtension performs component 
registration. Does anybody know of a way to declaratively specify which version 
of the .NET runtime will be used by the ComPlusExtension?
 
Internally it looks like the ComPlusExtension uses .NET's 'RegistrationHelper' 
from System.EnterpriseServices. My deployment platform has both .NET 1.1 and 
.NET 2.0 installed, so default runtime behaviour means the 2.0 version of 
System.EnterpriseServices will be used. The problem I have is that my .NET 1.1 
assemblies cannot be registered using the 2.0 version of 
System.EnterpriseServices - but are perfectly happy with the .NET 1.1 version.
 
Working with WiX 3.0 (3.0.3307.0) and the ComPlusExtension I have the following 
Component definition:
 
...
<Component Id="C__Server_MyAssembly.dll" 
Guid="65513B46-AF34-400C-9E73-71057F6AFB19" DiskId="1">  <File 
Id="CF_Server_MyAssembly.dll" Name="MyAssembly.dll" KeyPath="yes" Assembly="no" 
Vital="yes" Source="$(var.BuildDirectory)\MyAssembly.dll" />  <File 
Id="CF_Server_MyAssembly.pdb" Name="MyAssembly.pdb" Vital="yes" 
Source="$(var.BuildDirectory)\MyAssembly.pdb" />  <File 
Id="CF_Server_MyAssembly.tlb" Name="MyAssembly.tlb" Vital="yes" 
Source="$(var.BuildDirectory)\MyAssembly.tlb" />
  <complus:ComPlusApplication Id="ComPlusApp_MyApplication" 
Name="MyApplication" Activation="inproc" ApplicationAccessChecksEnabled="yes" 
AccessChecksLevel="applicationLevel" 
ApplicationId="7829CE93-DC2D-4AF5-9DC9-F36E7668632E">    
<complus:ComPlusAssembly Id="ComPlusAssembly_MyAssembly" Type=".net" 
DllPath="[#CF_Server_MyAssembly.dll]" TlbPath="[#CF_Server_MyAssembly.tlb]" 
RegisterInCommit="no" >    </complus:ComPlusAssembly>  
</complus:ComPlusApplication></Component>...
 
At install time, using verbose msiexec logging I find the following:
 
...
MSI (s) (A8:64) [08:45:33:608]: Invoking remote custom action. DLL: 
C:\WINDOWS\Installer\MSI3C73.tmp, Entrypoint: 
ComPlusInstallExecuteComPlusInstallExecute:  ExceptionInfo: Code='0', 
Source='System.EnterpriseServices', Description='Failed to register assembly 
'MyAssembly, Version=2.1.24.0, Culture=neutral, 
PublicKeyToken=65dfdc2390635595'.', HelpFile='', 
HelpContext='0'ComPlusInstallExecute:  Error 0x80020009: Failed to invoke 
RegistrationHelper.InstallAssembly() methodComPlusInstallExecute:  Error 
0x80020009: Failed to register .NET assemblyComPlusInstallExecute:  Error 
0x80020009: Failed to register assembly, key: 
ComPlusAssembly_BusinessProcessComPlusInstallExecute:  Error 0x80020009: Failed 
to register assemblies...
Kicking off 'regsvcs.exe' for .NET 2.0 I get:
 
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>regsvcs /c /extlb 
/tlb:"C:\MyApplication\v2-2\Server\bin\MyAssembly.tlb" 
"C:\MyApplication\v2-2\Server\bin\MyAssembly.dll"Microsoft (R) .NET Framework 
Services Installation Utility Version 2.0.50727.1378Copyright (c) Microsoft 
Corporation.  All rights reserved.
The following installation error occurred:1: Failed to register assembly 
'MyAssembly, Version=2.1.24.0, Culture=neutral, 
PublicKeyToken=65dfdc2390635595'.2: Binary format of the specified custom 
attribute was invalid.
 
But using 'regsvcs.exe' for .NET I get:
 
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>regsvcs /c /extlb 
/tlb:"C:\MyApplication\v2-2\Server\bin\MyAssembly.tlb" 
"C:\MyApplication\v2-2\Server\bin\MyAssembly.dll"Microsoft (R) .NET Framework 
Services Installation Utility Version 1.1.4322.573Copyright (C) Microsoft 
Corporation 1998-2002.  All rights reserved.
 
Installed Assembly:        Assembly: 
C:\MyApplication\v2-2\Server\bin\MyAssembly.dll        Application: 
MyApplication        TypeLib: C:\MyApplication\v2-2\Server\bin\MyAssembly.tlb
 
 
I was able to create a workaround by creating an 
'C:\windows\system32\msiexec.exe.config' with a supportedRuntime for just v1.1. 
However I don't really consider this an acceptable workaround - as it requires 
changing the global behavior of Windows Installer!
 
I also tried specifying the 'COMPLUS_Version' environment variable before 
running 'msiexec' to install the package - however this didn't work.
 
There is also a reference to the 'Binary format of the specified custom 
attribute was invalid' error on MS Kbase: 
http://support.microsoft.com/kb/918459/en-us. However, my problem repros on XP 
and Win2K3, and the only attributes on the classes & methods in my assembly are 
AutoCompleteAttribute and TransactionAttribute from EnterpriseServices!
 
 
So - back to my original question: Does anybody know of a way to declaratively 
specify which version of the .NET runtime will be used by the ComPlusExtension?
 
Alternatively, is there a way to force msiexec or the WiX custom actions to 
only .NET 1.1 for a given installation?
 
Thanks in advance,
Andrew
 
 
 
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to