Converting Web Site Project to Web Application Project - visual-studio-2010

I recently changed my project from a Website Project to a Web Application project so I could use build events.
I'm having all sorts of problems now trying to develop.
When I build the project and reload it in the web browser, it hardly ever loads the right version (sometimes it does).
Like if I make a simple update to some text, it will load the last page, like it's using a cached version of the page or something.
Also when I try to debug, it will never hit the breakpoints. I'm not sure what I need to change to fix this issue, any help would be greatly appreciated.

What browser are you using? The chances are the pages are being cached. With most browsers you can do Ctrl + F5 to force a reload of the cached files.
In Internet Explorer, you can change the option for Temporary Internet Files to 'Every time I visit the webpage', but be aware that this affects all sites you visit.
If you are talking about changes to binaries, you might need to do an iisreset. If you are still having issues, try deleting ASP.NET temp files.

Related

How to live code in .NET Core 3.1 application while using IIS server?

Recently I reinstalled my PC. I had my project hosted on IIS server, I remember that in Visual Studio I had to prepare IIS profile in debug options with hosting model OutOfProcess and then when I made some changes in code and hit refresh button in browser, project was automatically recompiling and giving me new results. It was basically live coding.
Ofc just refreshing page without any changes in code didn't trigger recompiling and browsing project was smooth.
I have no idea how did I achieve that, I was looking through internet for a while and coulnd't find solution. Every solution I found says to use dotnet watch run.
Right now I have same setup and it kinda works, but I have to hit compile every time I change something in order to see results on web which is really annoying.
Any idea how to achieve live coding with IIS?
EDIT:
I found the option I was looking for, but seems like it is set correctly and refresh doesn't trigger an rebuild.
I found partial solution, when I select:
Or:
It does work, however I think before it was working automaticaly without triggering an browser from VS. I'd appreciate any solution without it, however it is good enough for now.

Can sites built with Rapidweaver be worked on without Rapidweaver?

A friend has asked me to do some work on his existing site which was built in Rapidweaver. I'm on Windows, so is there another way I can access and edit his site?
The Rapidweaver project file is meant to be edited only in Rapidweaver, really. As far as I know, the only way around would be to use an HTML editor to modify the pages that are already in the server. However, I would not reccomend you to do it unless you are not going back to Rapidweaver anymore. Because changing the files in the server does not update your local Rapidweaver files. So, you could end up editing something in the server, then getting back to Rapidweaver and upload a "new" version that would not be completely up to date (the previous changes in the server version would be overriden by the older rapidweaver project).
For that kind of work, a CMS (Content Management System) is a more flexible way to work. Nowadays, one of the most common is Wordpress. It will require an inicial setup but after it is working it can be updated from anywhere via web browser, or even from an app in your iPhone. But it is not a Rapidweaver based sollution.
There are a couple CMS related plugins or stacks (Dropkick CMS, Armadillo, Easy CMS, Total CMS...) for Rapidweaver that could also be useful in this context. Once again, first you would need to buy a licence and to setup the website using one of those plugins or stacks. Only then you would be able to edit on the go.

Does Visual Studio Publish to Azure Website Cause Whole Site to Recycle?

We've recently launched a new website in Azure (i.e. Azure Websites) and as is typical with new launches we've had to deploy a few tweaks to fix minor issues shortly after launch.
We want to use Slots in the long run but this is not possible at the moment. Hence we are deploying to the live site. It's a fairly busy site with a good amount of traffic and obviously want to keep downtime to am minimum.
We are using Visual Studio to publish file changes to Azure but have noticed that even if we publish a relatively insignificant single file the whole site goes down and struggles to come back up. I was assuming that publishing a single file would literally just replace that file on the file system but it's behaving more like it recycles the application pool (or Azure equivalent) for the site. The type of files I've been publishing have been Razor views, hence would not typically cause a recycle.
Does anyone know what actually happens under the hood of VS Publish and if there is a way to avoid this happening?
Thanks.
I just tried this using a basically clean new MVC app (https://github.com/KuduApps/Dev14_Net46_Mvc5), and I did not see this behavior. The Index.html view has a hit count based on a static, which would tell us if the app or the page got restarted (or if that specific page got recompiled).
Then the test is to publish it, make a change to some other view (about.cshtml), and publish again. WHen doing this and hitting Index.cshtml, the count keeps going up, and there is minimal slowdown.
If you see it getting restarted after a view change, I suggest using Kudu Console to look at the files in site\wwwroot before/after the publish, and check what has a newer timestamp (e.g. check web.config, bin folder, ...).

Shared Hosting Compilation

It seems that whenever I upload a file onto my shared hosting site, the site goes offline whilst it compiles the page no matter how slight the change is. It seems its compiling the whole site. I have something like 5000+ pages on my site. My question is :-
Is this normal on a shared hosting site?
Is there something I missed or have left out of the web.config that will force the compiler to only compile as and when the page is accessed rather than compile the whole site which it seems to be doing?
Yes, IIS recompiles everything into assemblies, so a small change might affect the whole site. Because of this, the whole site is recompiled. It's recommended to do deployments like this during off-peak hours due to the delay.
One thing you can do is to precompile the site before deploying it to the server. You can find this option when publishing the site in visual studio (right click on the project node in Solution Explorer and choose publish.)

Clearing cache in the server

This is related to my problem here:
Editing velocity template of Liferay changes not showing or takes a while
I've tried to investigate the caching problem and tried different things. Here's what I found out.
I just found out that my css is also delayed in showing the updates. I tweak my css file adding comment and testing it on my browser. Now just requesting it on the URL it will just give me an older version of the file. now if i put a query asking for version, (eg. mystyle.css?v2) it will pull the latest file and it records it. I can even see different version, eg. (mystyle.css?v1) or (mystyle.css?v2. I've cleaned my cache so it's definitely on the server side (i think).
Is there a way I can clear my cache?
Thank You!
you can activate Liferay's developer setting by including the properties that are in ROOT/WEB-INF/classes/portal-developer.properties.
Explanation: Liferay minifies and caches CSS and Javascript - once this is done it will not examine those for changes. The developer settings will disable that.
However, you don't want this setting active in production as this will mean that you'll have to load dozens of files instead of very few combined+minified, well cached, files.
I assume you are using this for development, not in production.
If you're having these problems in production, you should rather work with a proper theme plugin and redeploy that.

Resources