5

I have the auto start feature configured for my server as outlined here:

http://msdn.microsoft.com/en-us/library/ee677260(v=azure.10).aspx

I am not using a custom method as I don't need to do any pre warming,

I just have the app pool set to auto start and the application with serviceAutoStartEnabled set to true.

<add name="PluckBuildServer" managedRuntimeVersion="v4.0" startMode="AlwaysRunning">
<application path="/" applicationPool="PluckBuildServer" serviceAutoStartEnabled="true">

Apparently this is not enough to kick off the WebActivator that Ninject uses to start up. Any ideas on how to get this work?? Also note that I really need to be able to script all of this using powershell.

This is the WebActivator line I have in my Ninject App_Start class:

[assembly: WebActivator.PreApplicationStartMethod(typeof(Pluck.Build.Server.App_Start.NinjectWebCommon), "Start")]

Your help is greatly appreciated.

Alex Spence
  • 1,478
  • 3
  • 17
  • 22
  • That's odd that WebActivator doesn't run. AutoStart just makes sure the app starts up. Given Webactivator just runs stuff, are you sure your apps is being started correctly? – Simon Halsey Jun 18 '13 at 21:31

1 Answers1

6

Ok, i just had a similar problem. Ninject didn't register when I ran the application on my local IIS (7.5), in IIS Express however, it worked fine. The problem was that I had batch="false" in my compilation node in web.config. Setting batch to true (which is the default) solved the problem.

Merrimack
  • 1,736
  • 14
  • 12
  • 1
    Similarly, the optimizeCompilations option appears to prevent this from working as well. Setting it back to "false" resolved this issue for me. – medkg15 Aug 20 '15 at 05:12