I believe RegAsm registers for COM not COM+ I believe. Also, I wouldn't recommend registering COM that way, it is better to use the built-in COM elements (Class, ProgId etc.) or write the registry keys directly.
-----Original Message----- From: Marek Mielcarek [mailto:[email protected]] Sent: 10 April 2014 20:34 To: General discussion about the WiX toolset. Subject: Re: [WiX-users] Register a .NET DLL in a COM+ Application - Could not install type library... Yes, you need to define custom action "Execute". Here is what works for me: (1)define custom action that executes RegAsm.exe; example: <CustomAction Id="ca_RegAsm_myDotNETassembly" Return="check" Execute="deferred" Directory="TARGETDIR" ExeCommand=""[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "[MY_APP_FOLDER]myDotNETassembly.dll" /codebase" /> (2)schedule the action (1) in your <InstallExecuteSequence>, something like this: <Custom Action=" ca_RegAsm_myDotNETassembly" Before="InstallFinalize"> <![CDATA[(&FeatureName = 3)]]> </Custom> Few notes: (a)the example uses RegAsm from framework v4 but you can modify to whatever you need (b)if you are registering your assembly in GAC you should remove /codebase from calling RegAsm (c)the example includes condition <![CDATA[(&FeatureName = 3)]]> which causes the action to be executed only when FeatureName is being installed. You can remove that if you do not need it. Thanks - hopefully it helps -----Original Message----- From: Davide [mailto:[email protected]] Sent: Thursday, April 10, 2014 7:58 AM To: [email protected] Subject: Re: [WiX-users] Register a .NET DLL in a COM+ Application - Could not install type library... Sorry for this repost... but does anyone have a solution for this? I'm close to write my own CA... Cheers, Davide 2014-04-04 8:22 GMT+02:00 Davide <[email protected]>: > Hi all, > > I spent a whole day with this problem now and would appreciate any help! > > To make it really easy I picked a sample COM+ Application from the > MSDN ( > http://code.msdn.microsoft.com/windowsdesktop/Creating-a-COM-Component > -7ffbab9b) and tried to register it in a COM+ application through WIX > - without success :( > > Here is my code: > > <ComponentGroup Id="BinFileGroup"> > <Component Id="MydotNet_dll" DiskId="1" > Guid="082B553D-C3D1-4D10-BA4F-8048C84C9C99" Directory="DIR_Bin"> > <Class Id="1F2642C4-BDE1-3B50-9DDE-F95747078F71" > Context="InprocServer32" Description="COMPlusServicesExample.Customers" > ThreadingModel="both" ForeignServer="mscoree.dll"> > <ProgId Id="COMPlusServicesExample.Customers" > Description="COMPlusServicesExample.Customers" /> > </Class> > <Class Id="94464148-E1E2-3F84-BEE9-7C72F0D0E01D" > Context="InprocServer32" Description="COMPlusServicesExample.CustomersDB" > ThreadingModel="both" ForeignServer="mscoree.dll"> > <ProgId Id="COMPlusServicesExample.CustomersDB" > Description="COMPlusServicesExample.CustomersDB" /> > </Class> > <File Id="COMPlusDotNet" Name="COMPlusDotNet.dll" > Source="$(var.BinDir)\COMPlusDotNet.dll" KeyPath="yes" Assembly="no" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\Implemented > Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32\1.0.5206.28472" > Name="Class" Value="COMPlusServicesExample.Customers" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32\1.0.5206.28472" > Name="Assembly" Value="COMPlusDotNet, Version=1.0.5206.28472, > Culture=neutral, PublicKeyToken=2cda2eca579c96b4" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32\1.0.5206.28472" > Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32\1.0.5206.28472" > Name="CodeBase" Value="file:///[#COMPlusDotNet]" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32" > Name="Class" Value="COMPlusServicesExample.Customers" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32" > Name="Assembly" Value="COMPlusDotNet, Version=1.0.5206.28472, > Culture=neutral, PublicKeyToken=2cda2eca579c96b4" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32" > Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{1F2642C4-BDE1-3B50-9DDE-F95747078F71}\InprocServer32" > Name="CodeBase" Value="file:///[#COMPlusDotNet]" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\Implemented > Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32\1.0.5206.28472" > Name="Class" Value="COMPlusServicesExample.CustomersDB" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32\1.0.5206.28472" > Name="Assembly" Value="COMPlusDotNet, Version=1.0.5206.28472, > Culture=neutral, PublicKeyToken=2cda2eca579c96b4" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32\1.0.5206.28472" > Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32\1.0.5206.28472" > Name="CodeBase" Value="file:///[#COMPlusDotNet]" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32" > Name="Class" Value="COMPlusServicesExample.CustomersDB" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32" > Name="Assembly" Value="COMPlusDotNet, Version=1.0.5206.28472, > Culture=neutral, PublicKeyToken=2cda2eca579c96b4" Type="string" > Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32" > Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" /> > <RegistryValue Root="HKCR" > Key="CLSID\{94464148-E1E2-3F84-BEE9-7C72F0D0E01D}\InprocServer32" > Name="CodeBase" Value="file:///[#COMPlusDotNet]" Type="string" > Action="write" /> > <complus:ComPlusApplication Id="MydotNet" Name="COM Plus > Services Example"> > <complus:ComPlusAssembly Id="COMPlusDotNet" > TlbPath="[#COMPlusDotNetTlb]" Type=".net" DllPath="[#COMPlusDotNet]"> > <complus:ComPlusComponent Id="CheckInterface" > CLSID="1F2642C4-BDE1-3B50-9DDE-F95747078F71"/> > <complus:ComPlusComponent Id="CheckInterface2" > CLSID="94464148-E1E2-3F84-BEE9-7C72F0D0E01D"/> > </complus:ComPlusAssembly> > </complus:ComPlusApplication> > </Component> > <Component Id="MydotNet_tlb" DiskId="1" > Guid="82E37437-9A85-4D93-985A-930AE8B5562B" Directory="DIR_Bin"> > <File Id="COMPlusDotNetTlb" Name="COMPlusDotNet.tlb" > Source="$(var.BinDir)\COMPlusDotNet.tlb" KeyPath="yes" > > <TypeLib Id="{382C73BF-1243-3749-ABFC-EE2FF15CC160}" > Description="This is an example for creating COM+ Serviced > applications in .NET" HelpDirectory="DIR_Bin" Language="0" MajorVersion="1" > MinorVersion="0"> > <Interface Id="{4F36FC57-4D0A-38BF-9A0D-ECDD5C8E29A4}" > Name="_Customers" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" > ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" /> > <Interface Id="{68D25731-3207-39B0-AE21-CE6AD66A2F8A}" > Name="_CustomersDB" > ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" > ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" /> > </TypeLib> > </File> > </Component> > </ComponentGroup> > > The error message I get: > > ComPlusInstallExecute: ExceptionInfo: Code='0', > Source='System.EnterpriseServices', Description='Could not install > type library 'C:\ApplDir\COMPlusDotNet.tlb' into application COM Plus > Services Example', HelpFile='', HelpContext='0' > ComPlusInstallExecute: Error 0x80020009: Failed to invoke > RegistrationHelper.InstallAssembly() method > ComPlusInstallExecute: Error 0x80020009: Failed to register .NET > assembly > ComPlusInstallExecute: Error 0x80020009: Failed to register assembly, > key: COMPlusDotNet > ComPlusInstallExecute: Error 0x80020009: Failed to register > assemblies > > When I comment out this part: > > <complus:ComPlusAssembly Id="COMPlusDotNet" > TlbPath="[#COMPlusDotNetTlb]" Type=".net" DllPath="[#COMPlusDotNet]"> > <complus:ComPlusComponent Id="CheckInterface" > CLSID="1F2642C4-BDE1-3B50-9DDE-F95747078F71"/> > <complus:ComPlusComponent Id="CheckInterface2" > CLSID="94464148-E1E2-3F84-BEE9-7C72F0D0E01D"/> > </complus:ComPlusAssembly> > > An empty ComPlusApplication is created successfully. When I then > manually install the tlb (or the dll) via MMC snap-in into this COM+ > application it works fine. > > I also tried the DllPathFromGAC attribute and register the DLL in GAC, > but it also failed with an error message, that the assembly name could > not be found in the GAC. > > Thank you in advance! > > Best regards, > > Davide > ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ WiX-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-users

