You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to access some information about features from C# CustomAction code. I'm using session.Features accessor to get FeatureInfo object for the existing feature in the msi. I can get FeatureInfo.Name without error but accessing FeatureInfo.Title or FeatureInfo.Description throws an exception with following message - The handle is invalid.
I'm not sure if I'm missing something or doing something wrong or it's just a bug.
I'm using wix v4.0.1.
I would appreciate any help you could provide.
Please find minimal working example that can be used to reproduce the issue:
usingSystem;usingSystem.Collections.Generic;usingWixToolset.Dtf.WindowsInstaller;namespaceWixCustomActions{publicclassCustomActions{[CustomAction]publicstaticActionResultFeatureTest(Sessionsession){session.Log("Begin FeatureTest");varfeature=session.Features["MainFeature"];try{session.Log("Name: {0}",feature.Name);}catch(InstallerExceptionex){session.Log("FeatureTest, unable to get name, exception: {0}",ex.Message);}try{session.Log("Title: {0}",feature.Title);}catch(InstallerExceptionex){session.Log("FeatureTest, unable to get title, exception: {0}",ex.Message);}try{session.Log("Description: {0}",feature.Description);}catch(InstallerExceptionex){session.Log("FeatureTest unable to get description, exception: {0}",ex.Message);}returnActionResult.Success;}}}
Logged output messages:
Calling custom action CustomActions!WixCustomActions.CustomActions.FeatureTest
Begin FeatureTest
Name: MainFeature
FeatureTest, unable to get title, exception: The handle is invalid.
FeatureTest unable to get description, exception: The handle is invalid.
Action ended 12:33:31: FeatureTest. Return value 1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to access some information about features from C# CustomAction code. I'm using
session.Features
accessor to getFeatureInfo
object for the existing feature in the msi. I can getFeatureInfo.Name
without error but accessingFeatureInfo.Title
orFeatureInfo.Description
throws an exception with following message -The handle is invalid
.I'm not sure if I'm missing something or doing something wrong or it's just a bug.
I'm using wix v4.0.1.
I would appreciate any help you could provide.
Please find minimal working example that can be used to reproduce the issue:
test.wixproj
file:test.wxs
file:CustomAction.csproj
fileCustomActions.cs
file:Logged output messages:
Beta Was this translation helpful? Give feedback.
All reactions