How to enable feature?

Mar 11, 2014 at 10:30 AM
Edited Mar 11, 2014 at 10:31 AM
Hi,

Thanks for the wrapper, it is great.

I'm trying to enable a Windows feature by its name, for example "WCF-HTTP-Activation45".

My code:
DismApi.EnableFeatureByPackageName(m_dismApiSesseion, "WCF-HTTP-Activation45", packageName:=Nothing, limitAccess:=False, enableAll:=True)
(Its vb.net, nothing = null)

I get the following exception:
The parameter is incorrect, Value does not fall within the expected range.
Stack trace:
at Microsoft.Dism.DismApi.EnableFeature(DismSession session, String featureName, String identifier, DismPackageIdentifier packageIdentifier, Boolean limitAccess, Boolean enableAll, List1 sourcePaths, DismProgressCallback progressCallback, Object userData) in d:\CodePlex\ManagedDism\Microsoft.Dism\DismApi.cs:line 481
at Microsoft.Dism.DismApi.EnableFeatureByPackageName(DismSession session, String featureName, String packageName, Boolean limitAccess, Boolean enableAll, List
1 sourcePaths, DismProgressCallback progressCallback, Object userData) in d:\CodePlex\ManagedDism\Microsoft.Dism\DismApi.cs:line 384
at Microsoft.Dism.DismApi.EnableFeatureByPackageName(DismSession session, String featureName, String packageName, Boolean limitAccess, Boolean enableAll, List`1 sourcePaths, DismProgressCallback progressCallback) in d:\CodePlex\ManagedDism\Microsoft.Dism\DismApi.cs:line 366
at Microsoft.Dism.DismApi.EnableFeatureByPackageName(DismSession session, String featureName, String packageName, Boolean limitAccess, Boolean enableAll) in d:\CodePlex\ManagedDism\Microsoft.Dism\DismApi.cs:line 334
at ConsoleApplication1.Dism.DismApiManager.InstallFeature(String p_featureStringRep) in C:\SVN_BASE\UTILS_REPO\WebConfigEditor\ConsoleApplication1\DismEngine.vb:line 34
Coordinator
Mar 12, 2014 at 4:22 PM
Sorry this looks like it was a bug. I've checked-in a fix and published an updated NuGet package.