Download It Now! Exec Inline: A VS2003 add-in that lets you run a chunk of code

Execute Selected Code item on edit menu

A couple of months ago I showed a short demonstration of an addin i use called Exec Inline -- well here's the installer code for Visual Studio 2003

Download the Code for ExecInline Download the code for 'ExecInline'

How to install the add-in:

Just download the ".msi" file and run it. Follow the prompts, etc.

Now when you load Visual Studio 2003, you should find a new option in the Edit menu, called 'Execute Selected Code'

Add it to the toolbar in Visual Studio 2003

Add the command to the toolbar

Right click on the toolbar and select 'customize'. Then go to the 'commands' tab, select the 'Addins' category, and find the command called 'Execute Selected Code'. Drag the little icon (with the lightbulb) to a handy place in the toolbar.

How to use the add-in

  1. Highlight the code you wish to run.
  2. Press the 'Execute Selected Code' item in the Edit menu (or the lightbulb if you've added it to the toolbar).
  3. The code is compiled and immediately executed in its own little assembly

Sorry it's not Visual Studio 2005 friendly!

When I have a chance I'll create a Visual Studio 2005 version and release that too.

Sorry no code!

If I get the time, I'll perform a few urgently needed improvements to the code and then release that for ya. I'm really not trying to keep it to myself -- it's just hard to find the time.

When I've moved the project to Visual Studio 2005 then I'll possibly release the source code on CodePlex -- then additions and modifications can be sent in easily. It's a fun little tool, but far too limited in its current state.

All Credit Belongs to...

As I've said before, all credit for this invention goes to these four places:

Code compilation retyped from jconwell's Dot Net Script Project at CodeProject.

Wrapper around compilation via dstang2000's DynamicCompileAndRun project.

Help with writing a VS Add-in: Scott Swigart, PasteAs Visual Basic Add-in

And help with getting the currently selected text from the IDE, via Kevin McFarlane's VS Csharp Macros page.

CodeProject and MSDN, what brilliant resources! No credit goes to me -- jconwell, dstang2000 and Scott Swigart, they did all the tricky bits.

Also, the idea was partially inspired by Don Syme's F# interactive which I first saw mentioned on John Lam's website -- but mostly inspired by Ctrl-E from SQL Query Analyzer. In fact the more I look into this little side project the less credit I deserve. I am a flea on the back of bigger fleas, ad infinitum.

Feedback welcome!!

Thanks to the people who volunteered to beta test this previously. Sorry I didn't incorporate your feedback into this edition, but the words "no, still broken" weren't actually all that helpful ;-) Just kiddin, I appreciate your help. All ideas, complaints will be read thoroughly prior to deletion.


My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.