سؤال

I have a old .net 3.5 mvc project I needed to do some changes to, I finally got it to build in visual studio 2013 but I have one last problem, I do my Language detection in the Application_AcquireRequestState method of the Global.asax file, but this method is not being executed.

I'm not sure what can be relevant so if more information is needed let me know.

other then that the project seems to work, but is just skipping this method, other methods such as Application_Start and RegisterRoutes are being executed.

protected void Application_AcquireRequestState(object sender, EventArgs e)
{
}

---update---- I've put some code inside that illustrates that the method is not being executed at all

protected void Application_AcquireRequestState(object sender, EventArgs e)
{
    var test = 1;
    while (true)
    {
        test++;
    }  
} 

This has no effect on my application at all. I have a breakpoint at the var test = 1 and it is not working

هل كانت مفيدة؟

المحلول

I've installed visual studio 2010 and opened the project, no issues what so ever.

I still don't know why it was not working in Visual Studio 2013.

I always strive to use the latest technology in this case the new IDE but at some point it is just not worth it.

نصائح أخرى

Have you tried turning of "Browser link"? I have had a couple of issues where request did different things then expected when this was turned on (it is on by default).

If you are using IIS Express or hooked up to the actual IIS on your machine, these events are being fired/processed outside of your code. You cannot put a break point on them unless you use the Visual Studio Development Server. (Or attach to the IIS process that is actually running your code.)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top