2

i am using following code snippet to restart IIS IIS with c#

But i am not finding ServerManagerDemoGlobals .I added both dll Microsoft.Web.Management.dll and Microsoft.Web.Administration.dll ,but still not able find it

Community
  • 1
  • 1
peter
  • 8,158
  • 21
  • 66
  • 119
  • any idea about ServerManagerDemoGlobals ?? – peter Apr 09 '16 at 16:51
  • I used following link [enter link description here](http://stackoverflow.com/questions/249927/restarting-recycling-an-application-pool?lq=1) – peter Apr 18 '16 at 16:03

1 Answers1

3

You don't actually need this type. You can delete the

PropertyBag applicationPoolBag = new PropertyBag();
        applicationPoolBag[ServerManagerDemoGlobals.ApplicationPoolArray] = applicationPool;
        arrayOfApplicationBags.Add(applicationPoolBag);

lines all together and the code will still accomplish the application restart you're trying to achieve.

BornToCode
  • 9,495
  • 9
  • 66
  • 83