Execute DotNet Code on the fly

16 04 2009

Sometimes, we need to execute a short part of code to accomplish a unique and simple task, like deleting all files of a folder and his subfolders or testing a network communication… All sort of tasks that you don’t need/want to create a project or a page/form.

So, I have written on my spare time a Visual Studio AddIn(winform application) that can help me to execute this sort of code.

It’s a first shot realised in 1-2 hours, so it’s simple and incomplete but usefull.

I have call this plug-in JustInTimeCode(not the true meaning of Just-in-time, but greater than on the fly…)

As all visual studio plugins, the integration is difficult(installers are not adapted to deploy correctly VS add-ins), so I will explain the installation steps:

  1. Download the add-in here
  2. Rename the file extension to rar extension(.ppt to .rar)
  3. Extract the archive in your hard drive(ex: c:\Program Files\JustInTimeCode\)
  4. Copy the JustInTimeCode.AddIn file in your VS UserProfile directory (ex: user_name\MyDocuments\Visual Studio 2005\Addins or/and   user_name\MyDocuments\Visual Studio 2008\Addins)
  5. Edit the copied file(addin file) and change the path in the “Assembly” Markup to refere the assembly located in your program file folder(in my example, c:\Program Files\JustInTimeCode\JustInTimeCode.dll)
  6. Launch VS2005 or VS2008
  7. A new entry exist in your tool menu called JustInTimeCode. 

How to use it ? On your left, select the language and the references that you need to execute the code located on the text area(the references list in not exhaustive for the moment…) and click execute.





Linq Synchronizer

7 10 2008

The first time I was using Linq To SQL, I was frustrated by the fact VS2008 did not integrated the more simple fonctionnality called : “Synchronize DBML Shema with Database”. Just removing my classes from DBML Shema and perform a Drag&Drop from Server Explorer to schema was to much for me ^^.

So I wrote a simple VS 2008 plug-in which allow with 2 clics a synchronization between my database and My DBML Schema.

Here the installer :

Linq To SQL Synchronizer

Rename the .ppt file in .zip file.

After installing, the add-in file must be define in userProfile/documents/VS2008/Addins/ folder and the assembly, for example, in program files folder.

If problems comes, be sure to check the path of the assembly in the .addin file(userProfile). It must reference the assembly in the program files(in this case).

The add-in is too simple that I haven’t done a User Guide. I let you eval :-)