Why does my application have redirection issues when the appPool runs under a v2.0 .NET Framework? - asp.net

I have a web application which has been having a strange issue ever since I moved it to a new server. Users will be able to use the application for some time, but after a few page requests, they will be redirected to the default page and asked to log in again. For some reason, this issue occurs less and less the more the application is used. The issue then starts occurring again over night. The application was formerly running on a windows 2003 server and it worked fine there, so I believe the issue has something to do with the settings on the new server.
I am currently running the application on a windows 2008 server with IIS 7.
I looked through a bunch of different settings in IIS and changed many different things, but none of them seemed to solve the problem. But today, I tried changing the application pool to run under a v4.0 .NET Framework, and that seemed to solve the problem. The application pool formerly ran under a v2.0 .NET Framework.
I do not understand how changing the framework solved my problem. I do not see any connection between the .NET Framework version and my application redirecting to the default page.
Can anybody explain how / why this change in settings solved my issue? Any insight or help would be greatly appreciated.
Thank you

Related

Local Host redirected you too many times Issue with IIS

I am working on bringing a working web application onto a new computer running Visual Studio 2022 version 17.4.2 and .NET Framework 4.7.2. When running on local IIS (version 10.0) host there is a "local host redirected you too many times" issue. It suggests clearing cookies which has been done with no effect.
The same code works on other machines with no issues. Is there anything in IIS set up/configuration or that may be missing from Visual Studio or other installations? Thanks in advance.
So far we have tried debugging the code and including breakpoints for where the issue may be occurring, ensuring that the installations of windows feature and IIS management is the same as another where the program is working. Also created a .txt file that can be reached on local host and is in same location as the rest of the project.
Here are a few things you can try:
Try on another machine.
Try to remove as much rules as possible from web.config and keys and so on. Or if it's a single page you're having the error with try to remove as much code from it especially if there are redirect codes. And add breakpoints and debug.
Check the LOCAL application pool version if it's set same as the online .net framework version.

Accessing Session after upgrade to .net 4.5

I am having problems accesing the session after upgrading a web project to .net 4.5
firstly, I had a functional .net 3.5 web forms project which I upgraded to .net 4.5 on my dev machine. This compiled and worked well locally
Secondly I modified the application pools on my dev iis server to use .net 4.0 in preparation for running the new code deployment
Finally I deployed my upgraded project to the dev web server.
The problem is that I am getting an error straight away where I am being told I need to enable session state to access the session variables.
Background:
I have a master page which checks for the existance of a session variable. I have put this code in the page_init event of the master page to ensure it runs before the page_load of the content pages etc.
This technique worked fine under .net 3.5 and works well under 4.5 on the local dev machine. But does not work on the iis server.
I have followed various threads telling me to set enablesessionstate=true in the config all to no avail.
Could it be that there is either a problem with .net sites runnning .net 4.5 on iis with regards to sessions, or am I missing something more obvious.
Please help as this is very frustrating
Well, I have no idea what was causing this?
I have fixed the problem by creating a brand new .net 4.5 project and importing assets / pages from my preexisting site.
Remarkably doing it this way caused no issue with the session after deployment to the web server, Very odd indeed. I can only assume that the project upgrade process that I initially used left some odd configuration in place which upset the server ???
Anyhow, have invested enough time in this now, thanks for taking the time to comment.

Can't debug ASP.NET application stored in IIS

I have a question regarding IIS (version 7.5) and ASP.NET (.NET Framework 4) . I am trying to debug ASP.NET web application which is stored on IIS. Now, I have done this in past and everytime it worked perfectly.
But now when I try to do same, **Visual Studio 2010** always gives me error, **"unable to start debugging on the web server. the iis worker process for the launched URL is not currently running" ...** even the application I had created in past (& stored in IIS) can't debug using Visual Studio. But all applications (new & old) can be accessed if I type their path in Browser, and they work fine too.
I did search on internet about my problem and I found many posts, but almost every post talks about activating **Windows Authentication** in IIS for the application in question. But, I am using Windows 7 home premium and the IIS shipped with this version doesn't support option for Windows Authentication. Also, if this is the only reason then why my old applications were working just fine till now without this Authentication method?? I found MSDN help about this error but it is not much helpful to me. I also checked APPLICATION POOL selection in IIS and my Application (both are using V.4.XX.XXX)... I have also checked **BINDING** , which is *:80 to Default Website, that means all requests to port 80 will be directed to default website (where my all applications reside)
As a side note, I have SharePoint Server 2010 installed. Which has its own website (which I have disabled while debugging) ...
I think there is something is changed in my IIS configuration, but I cant figure out what it is. And I am sure that it has something to do with SharePoint installation (may be because of more than one website on IIS for same port ??). Because I am using IIS for first time after installing SharePoint and I am having this error.
I will really appreciate if any one has answer ...
Thanks,
Jack
UPDATE: As I suspected ... having more than one site in IIS was root cause of trouble, Once I uninstalled Sharepoint Server 2010 and its web sites from IIS, my Visual Studio 2010 debugger was able to "Auto-Attach" w3wp.exe process while debugging any application ... ( I really don't see any reason that even after disabling all other websites why still it was giving me error at first place ?? )
I know its not a solution, because I have to remove Sharepoint Server ... but at present its more important for me to work on that application then Sharepoint Server.
But I am still open for any suggestions which might help me to run both together ....
Thanks,
Jack
Check the Bug fix for this issue in the Microsoft's Connect site.
.
Is it with .NET 3.5 in Visual Studio 2010 , if yes , then check http://www.ginktage.com/2010/08/fix-for-visual-studio-2010-hangs-when-debugging-asp-net-3-5-web-application/ for information

ASP.NET app never starts

After migrating my app to .NET 4 it's not starting. When i'm trying to load it in browser it endlessly loading it and nothing else happening. There is no errors or timeouts, just loading.
Please help. What should i do? What reasons there might be? I'm using IIS6 btw.
Did you register .NET 4 with IIS? Do you need to call aspnet_regiis.exe from the 4.0 directory?
Are you sure the app is using the correct Application Pool? Is the pool set to .NET 4? Is it integrated?
What does your web.config look like? Does the compilation node contain targetFramework="4.0"? Are you referencing 4.0 versions of the assemblies you need?
Unfortunately there is a ton of places to look into.
After some weird combination of IIS restarts, site stops and appPool recycles everything began to work fine.

Deployed ASP.NET application reverts to old code base?

We have an ASP.NET application running on a webfarm. When we release a new version and copy it to the production servers, occasionally it happens that after a few hours the application reverts to a an earlier code base.
Have anyone else experienced something like this? Would sharing an application pool between two applications running different versions of the code make this happen?
Additional information:
3 x web servers running w2k3/iis6
ASP.NET 3.5
I've had this happen rarely on non-precompiled sites and the solution was to stop IIS and clear out the temporary cache at:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
Is not a long-term solution, but will address the immediate problem. If not already, it is worth considering deploying the site pre-compiled.

Resources