SharePoint Sharpener

Obsessively Sharpening SharePoint

Using Console Apps for Proofing SharePoint Code

leave a comment »


Developing SharePoint solutions involves so much more than just coding, i.e. installing features, setting trust levels, associating with lists etc. This means that many things can go wrong on the road from idea to finished product.

Even if you just want to test a simple idea for a web part you still have to go through the process of installing the feature, inserting the web part on a page and so on. Far too time-consuming and annoying if all you want to do is throw a few lines of code at the SharePoint object model!

 

Quick proofing

More often than not, you don’t need the extended interface that a web part provides, in fact, a command prompt will probably be more than adequate.

That’s why you should use a console application for testing concepts; it’s really easy. Just create a new project and select Visual C# > Windows > Console Application:

image

Then add a reference to Microsoft.SharePoint.dll, and off you go:

  image

Hit F6 to build and then run the the exe-file in a command prompt:

 image

It really doesn’t get any easier than that.

Now just leave the sandbox and its command prompt open while working on other projects. Then you can return to the project at any time to test out ideas with a minimum of fuss.

Advertisements

Written by Thomas Sondergaard

July 3, 2008 at 9:37 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: