Adam
Adam

Reputation: 357

Recycling WCF Web Service on IIS

Is it possible to recycle a WCF web service hosted on IIS from code?

When a certain error code is received from an Oracle connection I am using, I want to recycle the web service.

Upvotes: 2

Views: 793

Answers (1)

Surjit Samra
Surjit Samra

Reputation: 4662

If you jus want to recycle your current application then try

HttpRuntime.UnloadAppDomain();

it will unload your app from host's memory and will load again on next request.

from MSDN

UnloadAppDomain is useful for servers that have a large number of applications that infrequently receive requests. Rather than keep application resources alive for the lifetime of the process, UnloadAppDomain allows programmatic shutdown of unused applications.

Upvotes: 2

Related Questions