0

I have used this method before in the assemblyInfo.cs folder of an asp.net mvc4 project. I am starting a new application and putting together the foundation and so far I have added ninject and log4net.

Now I am trying to call a static method from a class stored in the App_Start folder using:

[assembly: System.Web.PreApplicationStartMethod(
  typeof    (Dashboard.App_Start.EnvironmentConfigFileMover), "CloneEnvironmentConfigDirectory")]

in my assemblyInfo.cs file. And the class method isn't being called. I checked the spelling of the method against what is being used and no issues, and I am inserting a breakpoint and it just ignores me. Very frustrating. I have seen similar posts with issues using the preapplicationstartmethod from WebActivator. I have read WebActivator is built on top of system.web's preapplicationstartmethod, and I only need a simple method call, so I don't even need WebActivator which I doubt adding to my project will work since I can't even get the system.web one to work.

Anything I should be looking at to see what the issue is? Maybe did ninject or log4net make any changes somewhere that could be interfering with this?

Thanks!

Update: Btw I am running this locally on my laptop not server.

eaglei22
  • 2,589
  • 1
  • 38
  • 53

1 Answers1

0

I basically just created a new project and made sure the preapplicationstartmethod worked. After verification, I slowly added the additional items: areas, ninject, and log4net testing the functionality after each addition. Each time it worked fine.

Not entirely sure what was the original problem, but the only way I was able to resolve it was doing it this way.

I did first try adding WebActivator to the project just to make sure, but this didn't work.

eaglei22
  • 2,589
  • 1
  • 38
  • 53