SharePoint Development Tip: Clear Browser Cache with Post Build Event


Recently I have been working on a customization of Project Server 2010, which is over course built on SharePoint 2010.  One of the frustrating things I encountered was that changes to my JavaScript files didn’t seem to take affect.  Every time I made an adjustment to the script and then debugged the solution on my SharePoint development machine it would deploy the files but it wouldn’t always pick up the changes in the JavaScript files. 

I did finally figure out that if I started the solution in debug mode and when the browser launched I would to go Tools->Internet Options and clear the the browser history and then refresh the page it would pick up my changes.  But, oh my gosh, what a pain to have to do that every time I wanted to test something.

While looking for a sample about I watched the MSDN Webcast: Project 2010 JS Grid Extensibility: Project Web App (Part 1 of 3), there at the end was the answer I had been looking for. 

The solution use the Solutions Post-Build event to clear the cache before the browser launches, BRILIANT!  Not only was the tip great but it gave the command to add as well.

rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 8

Presto, chango, it worked like a champ, all are cleared from the cache before the browser starts.  I have had the issue since I add this.

If you are interested in watching al three videos you can find them here on the Project Programmability and Business Intelligence blog.

Happy SharePointing…

blog comments powered by Disqus


<<  August 2022  >>

View posts in large calendar

Month List