Installing a .NET 4.6.1 COM+ App - failed to register DLL #6817
-
Hi, I have a .NET 4.6.1 (I know that's EOL, we'll be updating it soon to 4.6.2) COM+ application DLL, and I'm trying to set this up using the WiX COM+ extension. I've been looking at the tutorial. When I build and run the install it's failing, and I think the reason might be the WixComPlusExtension uses a .NET version that's older than (and thus incompatible with) the version we're using for our COM+ dll. Here's what I have so far: <Component>
<File Source="$(var.IceDesktopWebDotnetBinFolder)/Sunquest.EnterpriseFramework.Core.dll" KeyPath="yes"/>
<File Source="$(var.IceDesktopWebDotnetBinFolder)/Sunquest.EnterpriseFramework.Core.tlb" KeyPath="no"/>
<complus:ComPlusApplication
Id="IceCachebaseApplication" Name="ICE Cachebase" Identity="NT AUTHORITY\NetworkService"
>
<complus:ComPlusAssembly
Id="IceCachebaseApplicationAssembly"
DllPath="[#Sunquest.EnterpriseFramework.Core.dll]"
TlbPath="[#Sunquest.EnterpriseFramework.Core.tlb]"
Type=".net" RegisterInCommit="yes"
>
<complus:ComPlusComponent
Id="IceCachebaseApplicationComponent"
MaxPoolSize="250000"
ComponentAccessChecksEnabled="no"
ComponentTransactionTimeout="1"
ComponentTransactionTimeoutEnabled="yes"
CLSID="066B8CED-9156-3E42-B85C-DFF2345F1FCE"
>
</complus:ComPlusComponent>
</complus:ComPlusAssembly>
</complus:ComPlusApplication>
</Component>
If I remove all the COM+ details and instead register the application and component using the COM+ wizard in the Component Services then it registers without error. One difference seems to be the fusion log, which when monitoring the install shows an error (which I initially dismissed because it's followed by an apparent success, but I think it may be real).
That failure doesn't happen when registering through the wizard. There's no description for the error, but apparently it's a runtime version mismatch:
That kind of makes sense when the fusion log says Compare this with the successful run, which says this:
VersionsMy COM+ dll is .NET 4.6.1 Questions
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I ended up writing my own custom actions using the COM+ COM API. I'll leave the code here in case it's useful to someone. [CustomAction]
public static ActionResult RemoveComPlusApplication(Session session)
{
var catalog = new COMAdminCatalog();
var collection = (COMAdminCatalogCollection)catalog.GetCollection("Applications");
collection.Populate();
for (var i = 0; i < collection.Count; i++)
{
var application = (COMAdminCatalogObject)collection.Item[i];
if (application.Name == "My Application")
{
session.Log($"Removing COM+ application {application.Name}");
collection.Remove(i);
}
}
collection.SaveChanges();
return ActionResult.Success;
}
static void SetComPlusApplicationProperty(Session session, COMAdminCatalogObject application, string propertyName, object propertyValue)
{
session.Log($" COM+ Application : {application.Name.PadRight(20)} set property {propertyName.PadRight(20)} = {propertyValue}");
application.Value[propertyName] = propertyValue;
}
[CustomAction]
public static ActionResult ConfigureComPlusApplicationDeferred(Session session)
{
session.Log("Starting to configure COM+ Application");
var assemblyPath = session.CustomActionData["AssemblyPath"];
try
{
var catalog = new COMAdminCatalog();
var applications = (COMAdminCatalogCollection)catalog.GetCollection("Applications");
var application = (COMAdminCatalogObject)applications.Add();
SetComPlusApplicationProperty(session, application, "Name" , "My Application");
SetComPlusApplicationProperty(session, application, "RunForever" , true);
SetComPlusApplicationProperty(session, application, "Identity" , @"NT Authority\NetworkService");
SetComPlusApplicationProperty(session, application, "RecycleExpirationTimeout" , 1);
SetComPlusApplicationProperty(session, application, "RecycleMemoryLimit" , 250000);
SetComPlusApplicationProperty(session, application, "Activation" , 1);
SetComPlusApplicationProperty(session, application, "ApplicationAccessChecksEnabled", false);
applications.SaveChanges();
session.Log($" COM+ Application : {application.Name} install component {assemblyPath}");
catalog.InstallComponent(application.Value["Name"], assemblyPath, string.Empty, string.Empty);
}
catch(COMException ex)
{
var errorRecord = new Record(0);
errorRecord[0] = ex.Message;
session.Message(
InstallMessage.User |
InstallMessage.Error |
(InstallMessage)MessageButtons.OK |
(InstallMessage)MessageIcon.Exclamation,
errorRecord
);
return ActionResult.Failure;
}
return ActionResult.Success;
} |
Beta Was this translation helpful? Give feedback.
I ended up writing my own custom actions using the COM+ COM API. I'll leave the code here in case it's useful to someone.