ObjectiveIn this article, we will see how to work with LINQ against IIS. Before applying LINQ against IIS sites and application pool, we need to set up the environment. Follow the bellows steps to do this. Step 1Download Microsoft.Web.Administration.dll and save to a particular directory. I am saving it in D drive of local storage. Step 2Create a new console project and add Microsoft.Web.Administration dll as service reference. To add a reference right click on the project and click add service reference. Then browse to the directory where, we have saved the downloaded dll of the first step. Step 3Add the name space Now we are ready to perform the query, Display all the sitesOutput Display all the sites which is started Output Display Site running in a particular application poolIn above query, we are performing nested query. We are just comparing if application pool name is as same as given name or not. Output ConclusionIn above article, I just discussed three basic LINQ query against IIS. I hope this post was useful . Thanks for reading. Happy Coding. |