Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging Global.Asax.cs
Message
 
General information
Forum:
ASP.NET
Category:
Troubleshooting
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01653548
Message ID:
01653551
Views:
35
UPDATE. Found https://stackoverflow.com/questions/1960651/is-it-possible-to-debug-global-asax

I have related question.

I have the following code
//   IPreferencesAdapterFactory preferencesAdapterFactory = (IPreferencesAdapterFactory)DependencyResolver.Current.GetService(typeof(IPreferencesAdapterFactory));
            ILoginImageDisplayDatesFactory factory = (ILoginImageDisplayDatesFactory)DependencyResolver.Current.GetService(typeof(ILoginImageDisplayDatesFactory));
            if (factory != null)
            {
                ILoginImageDisplayDatesAdapter adapter = factory.GetService();
                DateTime? dt = DateTime.Now.AddDays(-1);
                adapter.UpdateImageDates(dt);
            }
        }
The commented code works fine, but my code returns null for the factory. Do you see what may be wrong or what I may be missing?

Thanks in advance.

>Hi everybody,
>
>I'm trying to add an extra startup task when starting our application. In the
>
>
> protected void Application_Start()
>        {
>            ViewEngineConfig.Configure();
>
>            NinjectConfig.Configure(GlobalConfiguration.Configuration);
>            GlobalConfiguration.Configure(x => x.MapHttpAttributeRoutes());
>            WebApiConfig.Register(GlobalConfiguration.Configuration);
>            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
>            RouteConfig.RegisterRoutes(RouteTable.Routes);
>            BundleConfig.RegisterBundles(BundleTable.Bundles);
>
>            AutoMapperConfig.Configure();   // MUST come after call to NinjectConfig.Configure().   
>            ModelBindersConfig.Configure(); // MUST come after call to NinjectConfig.Configure().           
>            PreferencesLoad.Load();         // MUST come after call to NinjectConfig.Configure().
>            StartupTasks.Perform();
>            MainMenuConfig.RegisterMainMenu();
>
>        }
>
>I added StartupTasks.Perform(); and I put a breakpoint on the previous line as well as on that line and inside that Perform method.
>
>Nothing happens. My breakpoints are not being hit. However, I saw that the code was attempted to be executed, because I was getting null reference exception.
>
>So, why my breakpoints are not being honored and how can I debug that code? I am using the latest update for VS 2017 Enterprise.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform