Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 7.5 Auto Start Not working with Ninject using Web Activator

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.

like image 558
Alex Spence Avatar asked Jun 11 '13 17:06

Alex Spence


1 Answers

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.

like image 76
Merrimack Avatar answered Nov 15 '22 06:11

Merrimack