By calling pkgmgr.exe from C# with the following parameters, I was able to enable IIS 7 features ASP.NET and .NET Extensibility under Application Development Section.
/iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;...... /norestart /quiet
For IIS8, it is not working any more because there is no ASP.NET option under Application Development Features. Instead there are ASP.NET 3.5 and ASP.NET 4.5 (.NET Extensibility 3.5 and .NET Extensibility 4.5).
How can I enable them using pkgmgr.exe?