I have this simple code in aspnet :assuming no exceptions nor file locking nor process terminates :
new Thread(()=>{
Thread.sleep(15000);
It is not. When IIS decides to recyle the entire process it will take down both background and foreground threads. See this answer.
Luckily, you can make sure they are not interrupted. You can tell ASP.NET about your thread by implementing the IRegisteredObject interface. You can then register your object using HostingEnvironment.RegisterObject. See The Dangers of Implementing Recurring Background Tasks In ASP.NET