0

I have an asp.net app and I want when this app is running on IIS,to run under an application pool with classic pipeline mode.

I know how to fix it through the IIS manager but I am wondering if it is possible to fix it from my app. I want either to change the pool or change the managed pipeline mode of the defaultAppPool.

Thank you

Erik Oppedijk
  • 3,496
  • 4
  • 31
  • 42
Digital_Jo4
  • 56
  • 13

1 Answers1

0

If your application have the right permission you may run this command line:

appcmd set app /app.name:string /applicationPool:string

The variable app.namestring is the name of the application that you want to change, and the variable applicationPoolstring is the name of the application pool to which you want to add the application

reference: Change an Application Pool for an Application

You can run a command line from your application using the System.Diagnostics.Process.Start function, and a simple example : How to redirect command line output to a ASPX page using c#?

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150