I’ve been asked to write a tool that detects all the requirements and tells the user whether the machine meets all of the requirements or not to be able install the different software solutions the company I’m interning at developed.
I need to check if WCF3 and ASP.NET are registered to IIS correctly, The code is written in C#. I need a bulletproof way to know if it’s correctly registered or not.
Check this thread: Programatically create a web site in IIS using C# and set port number if you’re using IIS 7 you can programmatically access all registered sites. Keeping in mind the thread I provided discusses how to add a site programmatically, you should be able to use the “sites” collection to access all registered services and search for those by name or by other criteria (you’d have to check what properties are available).
It’s also important to note that if you’re interested in the application pool as well you’d access them like so:
Finally, your application will need to run under an account with the appropriate permissions to read this information.