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.
Related
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.
i am currently hosting my site on justhost (just as a test server), when i save my work on my local computer through aptana the files are automatically uploaded to the hosting server, and they appear fine. However this only works for my actual files like .php and .html
They do not work for my .css files, so if i save them and upload them the changes do not take effect, until like the next day, or if i turn my computer on and off and leave it a couple of hours, i am not sure why they are not taking effect immediately like the rest of the fiels.
I have tried deleting my cache and adding ?ver=1.0 to the end of the file name, but still no luck.
Also, i checked the hosting directly and the css file has updated to the correct version, but just does not show in browser.
Any ideas on what could be wrong, it would make life much easier if i could get them updating like the other files.
Thanks
I can't be sure what is causing this, but if I'm correct - the files do upload, its not a case of not uploading. It's one of these things
The Cache is holding it (already cleared it though?)
The file is doing some odd cross server transfer, depends what sort of hosting your on, but it may be the file is getting held up somewhere
Try clearing the DNS Cache
Start > type CMD > in the dialog type:
ipconfig /flushdns
That may force the computer to reload the file.
As for an ongoing solution to prevent it in the future I'm out...
I know it has been a while, but as others may find this question the way I did, the solution for me was to enable Cloudflare Developer Mode. Cloudflare was keeping the css files in cache and it drove me crazy to find the solution in another forum. I hope your case may be the same as mine as thus you can solve it as well.
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#
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.
After updating some ashx files and related dlls, my server is still executing the old versions. It continues to execute them even if I remove all of the files from the server.
What can I do to fix this?
EDIT
After 10-15 minutes the server reloads the application. That is a livable situation for a production server, but for development, it makes it very hard to get things done.
I have not been able to fix the server, but I came up with a hackish workaround. I created a page that calls HttpRuntime.UnloadAppDomain(). I just need to load that page when I push files to my development server.
Try removing the temporary ASP.NET folder contents.
Even in shared hosting you should be able to restart the app pools of your website. Can you try this?
If you cannot do this try this other trick: change the Url adding an unused parameters, i.e. ?foo=1 (I normally used this trick for other reasons but might also work in this context).
Try changing the Web.config file (any change, doesn't matter what). This will force the ASP.NET app to reload.
Changing the dll's in bin should have done this too, but it's worth trying to also change the Web.config file.