title: How do I retrieve a started Ignite instance when a website restart occurs in IIS?
body: <p>I use Apache Ignite .NET EntityFramework second level caching in my ASP.NET MVC 5 website. Everything work as expected on my development machine, but things get complicated when I try to publish the website using Web Deploy on the production IIS.</p>
  
  <p>I always get a <code>class org.apache.ignite.IgniteException: Ignite instance with this name has already been started: GridName</code> when I publish or restart the website on IIS. The error is pretty clear, Ignite is already running.</p>
  
  <p>The only way I found to get away this error is restarting the application pool of the website. However, I don't want to do this every time I publish the website in production  (which happens several times a week).</p>
  
  <p>I tried stopping the Ignite instance in the global.asax Dispose() or Application_End(), but the thing is that the AppDomain takes many seconds to stop. Ignite therefore has the time to try starting itself before it is stopped and causes the error mentioned above.</p>
  
  <p>I also tried to call <code>Ignition.TryGetIgnite()</code> to retrieve the running instance instead of trying to start it, but it always return null. Looking at the source code of this function in the Apache Ignite Github repository, I see that the Ignition object simply keeps a static list of nodes in memory and perform operations on this list. Since the AppDomain restarted at this point, the list is empty but the Ignite node is still running in the JVM.</p>
  
  <p>Is there a way to retrieve the Ignite instance or to stop it reliably, so I don't need to restart the application pool each time?</p>