Since I’ve been developing with Visual Studio 2010 for SP I can’t help but feel I’ve wasted valuable time trying to resolve issues that the caching mechanism used by Visual Studio has caused.
For example, I deployed a feature that created a list on the activating web using the ListInstance element. Initially, I set the name and description with hard coded values and all was good in the world.
I then added a feature resource and added entries for the list instance’s name and description. Deleting the list and re-deploying the solution (via Visual Studio) gave the desired result. I then decided to change the display title of the list and updated the resource file accordingly.
I once again deleted the list and re-deployed the solution. The name of the list stayed as it was originally in the resource file and had not updated with my change. Slightly perplexed, I double checked the feature in the hive to make sure the resource had been correctly deployed, which of course, it had.
Changing the name back to a hard coded value would correctly deploy but no matter what modifications I made to the resource string the title always showed using the original value given to it. This is obviously due to caching I thought and decided to reset iis prior to deploying again. As you might guess, this gave me the same results as before, still the wrong list title.
Restarting Visual Studio and trying the deploy again, I was fairly confident that it would deploy, but once again I got the same old list title. I restarted Visual Studio as I had experienced issues previously with deploying site column definitions that it complained about already existing, when I was completely certain that the column had been removed. Doing this had resolved things then, but not this time.
Deploying using PowerShell worked like a charm, confirming to me that the culprit here was indeed Visual Studio related. As restarting Visual Studio had not resolved my issue, I investigated further and found that doing this had not restarted the vssphost4.exe process. This process is responsible for executing SharePoint commands and had cached my resource file content. Restarting this process and deploying my solution finally gave me the desired results.