Clear Internet Explorer Cache Command Line

During a recent project where I was creating a SharePoint feature I had the need to clear the browser cache before starting a new debug session.  The feature was all JavaScript and I wanted to be sure I was getting the latest version.  So, I added this command to the post build event.

InetCpl.cpl,ClearMyTracksByProcess 8

I have also used this in trouble shooting browser issues with clients, the easiest way to know for sure they have cleared their browser cache.

Suppress All Upper Case In Visual Studio 2012

Richard Banks has posted a solution to make Visual Studio 2012 stop yelling at you.  In his post titles “How To Prevent Visual Studio 2012 ALL CAPS Menus!” he gives you the registry key to create to make them normal again.  Thank you Richard!

I have created a registry file to import to make the task easier.

Execute Command Files from Visual Studio 2010

On a recent project we used custom Visual Studio build files to build and deploy the code to different environments, i.e. Test and Production.  We created command files to pass the correct arguments to the build so it would be easier to run.  We never liked the fact that we need to open a command window and navigate to our solution folder to run the builds.  We thought, “There has got to be a way to do that from with in visual studio”, and we were right.  Devlin Liles details the steps we used to set that up in Visual Studio 2008 in his blog post titled Batch File and Command File running In Visual Studio.

I wanted to set that up in Visual Studio 2010 today and found the steps a little different so wanted to share how to set it up in Visual Studio 2010.

To realize the ability to execute command or batch files from within Visual Studio 2010 we need to perform the following steps:

  1. Create the External Command
  2. Adding the Command to the Context Menu

Setting up the External Command

  • Open the External Tools dialog by opening the Tools->External Tools menu.

image

  • Click the add [Add]  button to create a new External Tool and enter the following information:
Title E&excute Command…
Command C:\WINDOWS\System32\cmd.exe
Arguments /K $(ItemPath)
Initial directory $(ItemDir)
Use Output Window Checked
Prompt for arguments Not Checked
Treat output as Unicode Not Checked
  • Click the [Apply] button to save these changes, but before you click [OK] take now of a how many External Tools are listed here.  In my case it was the only external tool that had been defined so it will be assigned to External Tool 1
  • You can click [OK] now to close the External Tools dialog.

Adding the Command to the Context Menu

Now that we have our external command created we need to add it to the context menu for Solution Explorer items.

  • Open the Customize dialog by right clicking somewhere in the toolbar area to bring up the context menu and selecting Customize from the bottom of the menu.

image

This is where the steps for Visual Studio 2010 are different than Visual Studio 2010.  If you are using Visual Studio 2008 follow the instructions on Devlin Liles blog.

  • Select the [Commands] tab

image

  • Under Choose a menu or toolbar to rearrange: select Context menu: and in the drop down select Project and Solution Context Menus | Item.

image

I want my “Execute CMD…” command to be positioned above the “Edit WCF Configuration” items, so select “Edit WCF Configuration” and click the [Add Command…] button.

image

  • On the Add Command dialog in the Categories list select Tools.  Know in the Commands list scroll down until you see the External Command you are looking for.  Remember ours was External Command 1.  Once you find it select it and click [OK].

image

Now we see that External Command 1 is shown above the “Edit WCF Configuration” command, right were I wanted it. 

  • Now you can click [Close] button, open a solution and when you open the context menu in Solution Explorer you see the following:

image

Summary

This addition to Visual Studio has come in really handy for running common commands or batch files you might need to automate more mundane task.

Shared Assembly Info Files in Visual Studio Reborn

The last project I worked on had a lot of class library projects in it and we really struggled with file versions.  We really wanted a good way to give all the class libraries the save version number other information.  I seem to remember that in an older version of Visual Studio, 2005 I think, if you created a setup project you could tell it to make all the file versions the same.  I couldn’t get this to work in Visual Studio 2008, or 2010, and it doesn’t work for web applications.

After talking with several of my colleagues, Devlin Liles and Rob Tennyson, and others we came up with a solution of using a Shared Assembly Info file across the projects.  I am starting a new project and since I didn’t remember how we did it of course I consulted the great oracle of all collected knowledge, Google and found this article Shared Assembly Info in Visual Studio by Jeremy Jameson and this solution worked great.  I was able to get my new project well underway with Shared Assembly Files and got to bed early.

The benefits I have found so far are that all outputs of the build have the same number and you only have to update the product and file versions in one place.

If you have struggled with this in the past check be sure to check this out.

enjoy

Visual Studio 2008 Test Item Templates Missing

This week my current project decided to start using Visual Studio Team Test for manual UI test.  So, naturally someone had to write the test, but we didn’t have Visual Studio Team Tester Edition installed.  After installing it, which looked good, when I went to add a new “Manual Test (Word Format) none of the new Item Templates where there. 

After a little searching I can across this post from 2007 that said to run  the following to correct it.

   1:  C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv.exe /setup

From the post they believed that the issue was that the Item Template cache was not getting updated.  Running devenv.exe /Setup forces Visual Studio to merge the resource metadata that describes, menus, toolbars, and command groups from the VSPackages.  Evidently it also updates the Item Template Cache as well.

All is good and I am off created Manual Test now.

Calendar

<<  November 2017  >>
MonTueWedThuFriSatSun
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Month List