ASP.NET site not updating after changes - asp.net

So, I have a pretty basic ASP.NET site that was built and published via ftp through VS. Original publication went fine, as did the first few updates. But now I've made page changes (css as well as in the aspx files) and they don't seem to get pushed to the server. I believe that my code behind (C#) files are being updated since there are a few visual elements I call in the code. When I look at the ASPX files, they have old dates and the code is the prior version. VS says the publishing succeeded, and the host (GoDaddy) says there's no caching or quota issues on their side. If I upload a new dummy page it goes through... so it looks like updated pages are the issue.
What am I missing?

If it's styles have you tried doing a hard-refresh on your browser? If everything is saying the files are updated then maybe you have a locally cached version.

Related

IIS Express Caching

I have a .Net project that started in Visual Studio 2008, upgraded to VS 2012 and is now in VS 2015. I'm having an issue where I update basic HTML in an ASPX page and when I refresh my browser, none of the changes are pushed across. This happens every time the project is opened and only gets the current version of the file on the first build. If I open the project, build the project, view it, any changes after this point are never displayed in the browser unless I completely close out of VS.
I did think it might be the browser but I've loaded a completely different browser (after clearing my local cache) that I hadn't used before on this machine and the page is still displaying the old information. So I feel like there is a setting somewhere in the project that got carried over from a previous version of VS that is causing the local IIS Express to not pull the latest ASPX file from the hard drive.
I tried to delete the .vs directory while VS was closed and then start it up but I had the same result.
How can I get my changes in VS be visible to IIS Express and then to whatever browser I'm using to view it?
Update: I recently updated a CSS file and those changes were immediately seen in the browser. So, it's only the ASPX files that are not updating when saved.
After some time and digging around, I found that this happened on my DEV server as well. I looked through the web.config file and this setting had some how been added to the system:
<system.web>
<httpRuntime fcnMode="Disabled" />
</system.web>
This fcnMode is a file change notification setting that communicates when a file has been updated so that the old information isn't served up again. I removed this setting entire (setting it back to the default) and it's working as expected now in all environments.
Some more info on this setting if you'd like to read the MSDN docs:
https://msdn.microsoft.com/en-us/library/system.web.configuration.fcnmode

Edits in .asp net website wont show

i've got an issue with website made in asp.net. A site is published and online, i've made some modifications, republished site on my computer and just uploaded a .aspx file into the server via ftp.
First time it seems to have worked after a while. But i've made a small error and want to edit it again, i did the same, but it wont change. Could it be that i need to wait some time before changes are seen? Or could it be that there needs to be a server restart or something?
If you've edited something in the aspx.cs page you will need to upload the bin directory to the remote site, or better still republish the whole site.
If it is a change to the .aspx, css or javasctipt file, the original will most likely be cached in your browser. Try a differrent browser brand or refreshing the page, ctrl-f5 does a complete refresh.
If this error was by any chance a CSS mistake, that can be easily fixed by adding a "?" at the end of the address since CSS files are normally stored in the cache of the browser and the ? tells the browser to update them. Same thing is true about JavaScripts which are kept in individual files
I'd recommend you to use the Visual Studio Publish Website under the Build instead of manually uploading the site over FTP. That built in publisher provides you many advantages of which one of them is the same issue you have faced. When you make a small change, fixing the error in host would be very faster by republishing the site that way rather than manually upping it over FTP.

Why does Web developer built-in web server serve zero byte files suddenly?

Visual Web Developer 2010 Express. C#, MVC3.
Clicking F5 to debug.
It starts up the built-in ASP web server on http://localhost:50188/
The Output window tells me WebDev.WebServer40.EXE is loading loads of DLLs.
Up until yesterday it worked. Today all URLs give me a blank page!
All controllers (all that changed yesterday was one controller, and some of its views; but it was working yesterday after all those changes). Same results in two different browsers. Use a different port gives an error (Telling me that there is something listening on port 50188!!) No errors anywhere. Just 0 byte files received.
My question is What happened and how do I fix it?
More Info:
Rebooting the machine made no difference.
I also found the obj/Debug directory and deleted it. It got recreated next time I hit F5 to debug. Still exactly the same problem!
And I went back 24hrs, in git, and still the same problem. So I'm sure the problem is not being caused by any of my source files. (The .csproj file is in git too.)
Look for a file called app_offline.htm (in your web root directory). It is a zero byte file. If it exists then this is served instead of any of your content! (It is a great feature if you wanted to take your site down for maintenance - put a custom message in that file.)
The Fix: Simply delete it and your website starts working again!
It appears (and I'm not sure about this) that the file is put there automatically when both you and your website want to access the DB at the same time. It should be deleted again automatically. But I guess a crash of something might leave it behind.
(To be honest, I think it would have been much wiser to put some content in app_offline.htm, explaining what it is and why it was automatically created. Quietly creating a zero-byte file is a tad sadistic...)
More information here: Why does app_offline.htm keep appearing in my web project?
And here: http://www.daniweb.com/web-development/aspnet/threads/215912/why-app_offline.htm-is-created-automatically-whats-the-mystery#

IIS ASP.NET css/js files not updating until forced page refresh

When we do releases in IIS 7, we deploy new code to the releases directory on the server and then repoint the website in IIS to the new code directory. For example:
Change website directory from C:\company\releases\code-5-17-12 to C:\company\releases\code-5-26-12.
This strategy lets us revert back to a previous release in a worst-case scenario. However, the issue I'm having is that when a user who has been on the site goes to a page, sometimes they might need to explicitly refresh a page in order to get the new updated code.
Is this a caching problem? Is there a way to expire this somehow so users of the site will not be loading up old code from the previous release?
This is a specific problem with javascript files and css files.
The problem with that solution is that your users will always be downloading new css's and js's because <%=DateTime.Now.Ticks%> will be different in every refresh.
A better solution would be to concatenate the version of the application or even the last modified date of the file itself.
I got this to work:
I added a ?v=<%=DateTime.Now.Ticks%> to the end of each css and js filename and this solved it.

Visual studio pulling a cached page

I think my visual studio is pulling a cached version of a webpage. See I am putting in code in the page, but when I run the website it never shows up.
And if I delete parts of the webpage, they still show when I run it.
I tried to rebuild but it still doesn't work.
When you say "putting code in the page," are you referring to the markup (aspx/ascx/cshtml/vbhtml/etc), or a code file (.cs, .vb)?
If you're modifying the code-behind file (webforms) or a controller (MVC), and you're (hopefully) using a web application project instead of a website project, you need to recompile the solution for your changes to take effect.

Resources