webactivator

WebActivator PreApplicationStartMethod not working

本小妞迷上赌 提交于 2019-12-06 05:20:46
I'm making a new project following onin architecture. I have a separate project called "bootstrapper" that contain IOC and WebActivator.. My problem is that class that contain WebActivator not even loaded in debug ! May be i'm missing something ? [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(IocConfig), "RegisterDependencies")] public class IocConfig { public static void RegisterDependencies() { //.......... } } Your Onion.Bootstrapper project corresponds to the outermost layer of your Onion Architecture. It's the only projects that references all the others. Using WebActivator

Define an initialization order of WebActivator.PreApplicationStartMethod classes

风流意气都作罢 提交于 2019-12-05 10:51:03
I have several WebActivator.PreApplicationStartMethod decorated classes. One is for Ninject, another class for AwesomeMVC and a third one is for background task scheduler. The problem is that the scheduler class needs to take advantage of the dependecies, that are resolved by IoC container. My questions are: Can I have several WebActivator.PreApplicationStartMethod classes? Can I define order, in which they are initialized, so that IoC, being the most important, comes first? Can WebActivator.PreApplicationStartMethod static class instances rely on IoC container to resolve their constructor

Error in downloading WebActivator with NuGet

冷暖自知 提交于 2019-12-05 09:41:06
I just updated my NuGet Package Manager on my corporate machine. Ever since the update, I am unable to add any package. I tried to install WebActivator for instance and got the following error: PM> Install-Package WebActivator Install-Package : The ServicePointManager does not support proxies with the https scheme. At line:1 char:16 + Install-Package <<<< WebActivator + CategoryInfo : NotSpecified: (:) [Install-Package], NotSupportedException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand How can I go about this? Yasir The following work

asp.net MVC 4 with StructureMap

假如想象 提交于 2019-12-03 09:38:18
问题 I am converting an ASP.NET MVC3 project to MVC4. I was trying to find the best approach to work with StructureMap and MVC4. I've found a couple of solution which might work, but haven't tried them yet. The first solution is very simple and lightweight. The second one (Structuremap.MVC4) depends on WebActivator for the startup. What is the better and simplest approach? Do I still need to bootstrap everything and set the DependencyResolver with the WebActivator? Thanks for your help. 回答1: I did

Ninject.MVC3, Nuget, WebActivator oh my

巧了我就是萌 提交于 2019-12-02 20:39:39
I want to setup Ninject to do a simple test, as well as demonstrate the ease-of-setup using Nuget. I want to resolve a sample service. public interface ITestService { string GetMessage(); } public class TestService : ITestService { public string GetMessage() { return "hello world"; } } I run the NuGet Install-Package NinjectMVC3 .... it nicely drops NinjectMVC3.cs into my App_Start folder, decorated with some WebActivator attributes to get it all loaded. Next I add my binding in the NinjectMVC3.RegisterServices method: private static void RegisterServices(IKernel kernel) { kernel.Bind

Install-Package : Unable to find package 'WebActivator'

丶灬走出姿态 提交于 2019-11-30 00:52:11
问题 I have Visual Studio 2012 Express for Web. My Steps -Create a New ASP .NET MVC 4 application -choose basic template -go to Package Manager Console -try to install WebActivator PM> Install-Package WebActivator and i get the following error How i can resolve this and install WebActivator package? 回答1: In my case, I could not install any package and got a similar error. The issue was solved as I unchecked the "Microsoft and .NET" under "Machine-wide package source": I hope this can be help

Ninject and MVC3: Dependency injection to action filters

吃可爱长大的小学妹 提交于 2019-11-28 05:01:44
I've found loads of inconclusive articles and questions on how to do property injection on an ActionFilter in ASP.NET MVC3 using Ninject. Could someone give me a clear example please? Here's my custom auth attribute. public class CustomAuthorizeAttribute : AuthorizeAttribute { [Inject] public IService Service { get; set; } [Inject] public IAuthenticationHelper AuthenticationHelper { get; set; } public override void OnAuthorization(AuthorizationContext filterContext) { //My custom code } } I am using the WebActivator to set up Ninject [assembly: WebActivator.PreApplicationStartMethod(typeof

Ninject and MVC3: Dependency injection to action filters

烂漫一生 提交于 2019-11-27 05:29:08
问题 I've found loads of inconclusive articles and questions on how to do property injection on an ActionFilter in ASP.NET MVC3 using Ninject. Could someone give me a clear example please? Here's my custom auth attribute. public class CustomAuthorizeAttribute : AuthorizeAttribute { [Inject] public IService Service { get; set; } [Inject] public IAuthenticationHelper AuthenticationHelper { get; set; } public override void OnAuthorization(AuthorizationContext filterContext) { //My custom code } } I