using nuget for Ninject MVC3

pull/2/head
kay.one 14 years ago
parent 6ade4b4bd7
commit 45d9324055

@ -57,7 +57,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.2.2.1.0\lib\.NetFramework 4.0\Ninject.dll</HintPath>
</Reference>
<Reference Include="Ninject.Web.Mvc, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL" />
<Reference Include="Ninject.Web.Mvc">
<HintPath>..\packages\Ninject.MVC3.2.2.2.0\lib\net40-Full\Ninject.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL" />
<Reference Include="SubSonic.Core, Version=3.0.0.3, Culture=neutral, processorArchitecture=MSIL">
<HintPath>D:\My Dropbox\Git\NzbDrone\NzbDrone.Core\Libraries\SubSonic.Core.dll</HintPath>
@ -109,6 +111,9 @@
<Reference Include="TvdbLib">
<HintPath>..\NzbDrone.Core\Libraries\TvdbLib.dll</HintPath>
</Reference>
<Reference Include="WebActivator">
<HintPath>..\packages\WebActivator.1.4.1\lib\net40\WebActivator.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_GlobalResources\EditorLocalization.bg-BG.designer.cs">
@ -619,8 +624,6 @@
<Content Include="Content\XbmcNotification.png" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Libraries\Ninject.Web.Mvc.dll" />
<Content Include="Libraries\Ninject.Web.Mvc.xml" />
<Content Include="Scripts\2011.1.315\jquery-1.5.1.min.js" />
<Content Include="Scripts\2011.1.315\jquery.validate.min.js" />
<Content Include="Scripts\2011.1.315\telerik.autocomplete.min.js" />

@ -7,4 +7,6 @@
<package id="jQuery.vsdoc" version="1.5.2" />
<package id="jQuery.Validation" version="1.8" />
<package id="Glimpse" version="0.81" />
<package id="WebActivator" version="1.4.1" />
<package id="Ninject.MVC3" version="2.2.2.0" />
</packages>

@ -0,0 +1,52 @@
[assembly: WebActivator.PreApplicationStartMethod(typeof($rootnamespace$.App_Start.NinjectMVC3), "Start")]
[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof($rootnamespace$.App_Start.NinjectMVC3), "Stop")]
namespace $rootnamespace$.App_Start
{
using System.Reflection;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using Ninject;
using Ninject.Web.Mvc;
public static class NinjectMVC3
{
private static readonly Bootstrapper bootstrapper = new Bootstrapper();
/// <summary>
/// Starts the application
/// </summary>
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestModule));
DynamicModuleUtility.RegisterModule(typeof(HttpApplicationInitializationModule));
bootstrapper.Initialize(CreateKernel);
}
/// <summary>
/// Stops the application.
/// </summary>
public static void Stop()
{
bootstrapper.ShutDown();
}
/// <summary>
/// Creates the kernel that will manage your application.
/// </summary>
/// <returns>The created kernel.</returns>
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
RegisterServices(kernel);
return kernel;
}
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
}
}
}

@ -794,6 +794,12 @@
</summary>
<param name="createKernelCallback">The create kernel callback function.</param>
</member>
<member name="M:Ninject.Web.Mvc.IBootstrapper.InitializeHttpApplication(System.Web.HttpApplication)">
<summary>
Initializes a HttpApplication instance.
</summary>
<param name="httpApplication">The HttpApplication instance.</param>
</member>
<member name="M:Ninject.Web.Mvc.IBootstrapper.ShutDown">
<summary>
Releases the kernel on application end.
@ -810,6 +816,12 @@
</summary>
<param name="createKernelCallback">The create kernel callback function.</param>
</member>
<member name="M:Ninject.Web.Mvc.Bootstrapper.InitializeHttpApplication(System.Web.HttpApplication)">
<summary>
Initializes a HttpApplication instance.
</summary>
<param name="httpApplication">The HttpApplication instance.</param>
</member>
<member name="M:Ninject.Web.Mvc.Bootstrapper.ShutDown">
<summary>
Releases the kernel on application end.
@ -831,6 +843,17 @@
Gets the kernel.
</summary>
</member>
<member name="T:Ninject.Web.Mvc.HttpApplicationInitializationModule">
<summary>
Initializes a HttpApplication instance
</summary>
</member>
<member name="M:Ninject.Web.Mvc.HttpApplicationInitializationModule.Init(System.Web.HttpApplication)">
<summary>
Initializes a module and prepares it to handle requests.
</summary>
<param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param>
</member>
<member name="T:Ninject.Web.Mvc.NinjectDependencyResolver">
<summary>
Dependency resolver implementation for ninject.
@ -876,6 +899,11 @@
Initializes a new instance of the <see cref="T:Ninject.Web.Mvc.NinjectHttpApplication"/> class.
</summary>
</member>
<member name="M:Ninject.Web.Mvc.NinjectHttpApplication.Init">
<summary>
Executes custom initialization code after all event handler modules have been added.
</summary>
</member>
<member name="M:Ninject.Web.Mvc.NinjectHttpApplication.Application_Start">
<summary>
Starts the application.
Loading…
Cancel
Save