IIS serving an old version of files - asp.net

I am developing an ASP.NET application and deploying to an IIS 7 server via WebDeploy. This is a single server (no web farm or anything like this). I've been using the same setup for two years with no problems. Since last night, the server seems to be "stuck" on the last version of the web that I deployed before dinner. I deployed a couple of new versions today, but the server keeps serving the old pages.
I have triple checked this. When I log into the server via RDP and I open a specific ASPX file, I can see that it's the new version I've just deployed, so the server is actually storing the new versions. However, when I visit the web site over HTTP from my computer, I get the old version of the file.
I have restarted the server (the whole machine, not just IIS). I have disabled the IIS cache. I have disabled the compression cache. I have tried from multiple client computers, including one from which I had never ever visited this site (so no client cache may exist). But nothing worked.
I am aware that similar issues have been reported, and I have read some posts about it. But I seem to have exhausted all possible checks. Any ideas on how to proceed? Thanks.

After much struggling, I managed to solve this issue. I deleted the whole web site from the server, and I deployed it from a computer other than my usual development machine. This fixed the issue.
However, I am still baffled at why this happened. It must have been a glitch with WebDeploy and/or IIS.

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.

Local Debugging IIS application on my laptop using using remote IIS applications (with Rider)

I was witching and had my first few ASP.NET Razor Pages projects, debugging locally, publishing after, and everything went fine.
But now I temporarily took over a project from somebody with health issues, can not ask him things at the moment, maybe next month.
The projects run on two physical servers, five IIS-applications running, like API, Video-Handling, IndentityServer and a "WEB" for the user-interface. Endpoints defined in the "appsettings", I get it.
I changed some minor things at the User-Interface (WEB-Application), published it directly on the server and everything went fine. Pfff..
But... now I want to make some bigger changes and test them locally before publishing, but still using other unchanged IIS servers on the two servers, which do the "heavy-lifting". So I put some breakpoints like always, run "Debug" on Rider, express IIS server starts successfully, but I noticed the application redirects to the project on the remote server and then of course does not meet my breakpoints anymore, it is just running the old version on the server. Now I am missing something..., looked at several configuration files, how can I configure it, when it starts with the local IIS express server instead of the remote server? I want to stay on the local IIS express server, since I want to test the changes of course.
Hope I explained my issue well enough, did not know how to tell exactly.
Greetings to all!

Make Cassini (VS Development Web Server) Stop Overriding My 404 Responses

I have noticed that while debugging my site, any request that results in a 404 and appears to refer to a path on the disk relative to my configured virtual directory is intercepted by Cassini and rudely replaced with a directory listing. I'm using Nancy Framework, but given that this problem appears to be at the web server level, I suspect Cassini would act the same way for MCV applications. I can't find any documentation on this "feature" other than a related commit message on the Cassini source that says "...directory listing only overrides 404 responses for directories".
I would much rather my development web server stop trying to outsmart my framework. I makes the debugging experience more than a little jarring. In an MVC framework the request URLs have nothing at all to do with file locations, so the fact I'm getting directory listings for some invalid requests and the correct 404 page for others gets annoying. Not to mention it's making several of my unit tests fail because they rely on auto-generated content in my 404 error pages (which I can't manually test either).
Is there any way to disable this functionality in Cassini? I know I could install IIS Express, but I'd rather not. Especially since my unit test runner and hosts file (this is a multi-domain application) are already configured just right.
Stop using Cassini and start using IIS Express instead.
Cassini has many shortcomings (SSL support being one, the problems you are seeing another and many more).
IIS Express is based on IIS code and is as close to IIS as can be while still being lightweight.

Debug a hosted asp.net site?

Is it possible to debug (with VS 2008) a site at my host? I have no particular control of the server, I'm only allowed to upload my website files to the server. I can however upload .pdb files etc.
The reason for me wanting this is because the site works fine on my dev machine, but refuses to show even the first page when deployed on the server (404-error).
Maybe a long-shot, but in my experience the "works-on-my-machine-but-returns-404-on-the-server" problem is often a consequence of that the WebServer Extension "ASP.NET v2.0.50727" is prohibited.
As Ganesh R points out, it may sound like your application never gets startet.
As for the debugging part, I don't think you would be able to pull that off...
Debugging requires that certain debugging components are installed and enabled on the server. This is highly unlikely to be the case on any production hosting platform.
Contact your hosting provider - they will usually be quite willing to help you diagnose the problem you are encountering.

ASP.Net Web Site Won't Compile, But Works Anyway?

I have an ASP.Net 2.0 web site, using the DotNetNuke framework (4.09), and it will not compile, but when I hit the site in a browser, it works. Even the parts that don't compile will work. How is IIS able to compile and run this site, when Visual Studio can't? Everything is the same in both places... I copied the entire web site from the remote server on to my local machine, then I set it up in IIS the same way. On my local machine, Visual Studio can't compile the site, but it still runs. How can this be possible?
The specific errors are not important, as there are 189 of them, from every possible part of the site. I'm not trying to fix the errors... what I want to know is how it's possible for the web server to run the site, regardless of the errors. Please pay attention to what I have written - everything is exactly the same in both places. There are no missing DLLs, no different configurations, nothing on the machine itself... remember, the site runs fine on my local machine.
Is this a web site or a web application? If it's a web application, you're probably still running off the last successfully built bits in the bin.
The site is using old dlls, or possibly you have references missing in your local version that the server has just fine.
As Mitchel said, we need to see the error before we can really answer your question.
To give you an answer on this we would need to know what the errors are.
Your local machine cached the 'working' copy and is using that maybe?
The site was compiled successfully at one point as it works on the remote server. Thus, copying it to your local machine and hitting the local site will also work. However, there can be several reason why you can't re-compile it on your local machine including; missing references, web.config entries, third party control licensing, etc..
I realize you are not trying to correct the 189 errors, but there are clues, if not answers, in the error listing that will get you moving in the right direction.

Resources