Webactivator does not work on IIS 7

I have several web applications that use packages using WebActivator. On my local machine with IIS 7.5 Express, everything works fine, whether I test in Release or Debug versions. However, on my production machine with IIS 7.5, WebActivator does not actually start, so all the modules do not load, and I have to add the code back to the Global.asax.cs file.

I’m stumped about where to even start looking - Googled and searched StackOverflow, but haven’t run into anyone who has similar problems. Is there something explicit that needs to be configured to run it?

Edit - added a quick activator sample, which is registered in Windows. The content of the function added to the Global.asax.cs file works fine on the production server, but never registers from the activator.

using System.Web.Mvc; using System; [assembly: WebActivator.PreApplicationStartMethod(typeof(Admin.App_Start.WebActivatorTestStart), "Start")] namespace Admin.App_Start { public static class WebActivatorTestStart { public static void Start() { System.Diagnostics.EventLog log = new System.Diagnostics.EventLog(); log.Source = ".NET Runtime"; log.WriteEntry("WebActivator Start", System.Diagnostics.EventLogEntryType.Information); } } } 
+6
source share
1 answer

Well, I can’t say for sure what I did to fix the situation, but now it works.

A bit of history - I manage many different large applications using some common libraries. I have my shared web library, and where I had IOC setup with Ninject and WebActivator. There was an App_Start folder in this base library. Maybe this is the reason? I do not know. I never got a WebActivator to work with this installation, so I just used NinjectHttpApplication to handle the log and launch files. However, the core library still depended on WebActivator (there simply is no App_Start folder).

So now I'm working on refactoring some applications and core libraries - clearing up a bunch of code smell over the past few months. One of the steps was to move all IoC to the actual web application - to make the core libraries less monolithic. The core library is no longer dependent on WebActivator.

And now it works. There are also half a hundred other small changes that I made to the base library, so I apologize to others for not being more systematic.

0
source

Source: https://habr.com/ru/post/898991/


All Articles