The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,639,104
since: 19 Jan 2005

Visual Studio Extensions for WSS v3.0

posted Wed 13 Dec 06

There are really two different halves to this package. The first half is a set of new project templates that allow you to create site definitions, list definitions and of course - Web Parts. The second half of this package is the Solution Generator, which is basically a wizard for generating a solution that you can then use to add features and site definitions and list definitions.

The bottom line is that these tools take the tedious, mind-numbing, painful task of writing and deploying SharePoint code and reduce it to something that is actually useful. I can now hit "F5" when I'm looking at my Web Part and have it get wrapped up inside a feature which is then wrapped inside a solution which is then deployed to SharePoint and added to the list of available solutions automatically via a script that invokes stsadm -o addsolution, and then the feature in question is actually activated for me. If I had to create all the deployment files manually, then manually copy files, then manually run stsadm to add the solution then manually enable the feature, the entire task would have taken me probably an hour to deploy 1 line of code. Thats unacceptable and the WSS extensions for VS fix this problem, and they fix it quite well.

The first step is to download the extensions . Once you've got them downloaded, install them and you're good to go.

Creating a Hello World Web Part 

First, open Visual Studio 2005 and create a new Web Part project and call it HelloWorld. You should see a new Web Part. You will also notice that your project already has a strong name, is already strongly versioned at version 1.0.0.0, and already has a reference to Microsoft.SharePoint.dll. Right-click your project and go into properties and you'll see a new vertical tab called SharePoint Solution. This allows you to define all of the properties of your SharePoint solution, including the name, description, event receivers - you name it.

Next, click the Debug tab in the project properties window. You'll see that there is a "Deploy to URL" option. Set this to the URL of the top-most site of the site collection to which you want to deploy the web part. For example, in my case, I set it to http://win2k3r2lab/budget test site, which will add the solution to the farm and then install the feature at that particular site and will even activate it for me.

While you're at it, make sure you uncomment the writer.Write("HTML output"); line and replace the text with something meaningful, like, Hello World :)

At this point you've coded your Web Part, and you know how to code Web Parts because you've been reading my blog and you have a copy of my book in hand (well, when its published anyway) and you're ready to deploy. This is where it gets reaaaallly goooood. If you spent any time at all developing Web Parts for WSS v2.0 or even *gasp* v1.0, then you know exactly what a colossal pain in the butt it is to go from build to deploy and test. 

Not so here... Simply hit F5. The Web Part will be stuffed into a feature, which is stuffed into a solution, which is deployed to the farm (farm is obtained by examining the URL you gave VS 2005 in the "deploy to" location) and then activated at the site you indicated. From there, you can flip through the list of available Web Parts within SharePoint and add your newly created custom Web Part to the site of your choice, as shown below:

 

CAUTION: The Visual Studio 2005 Extensions for WSS v3.0 will only work on a server on which you have WSS v3.0 installed!!!

I will be posting another blog post shortly describing what I think is an ideal and fairly productive development environment for WSS v3.0 and MOSS 2007, so stay tuned! 

tags:              

links: digg this    del.icio.us    technorati    reddit




1. Mossman left...
Sat 06 Jan 07 10:15 am

Thanks for a very helpful post. Have you (or has anyone) figured out how to run VS 2005 Extensions for WSS v3.0 on a development machine (XP) that doesn't have WSS v3.0 installed? Perhaps that's what you'll be covering in your upcoming blog post, which is eagerly awaited. Thanks!


2. symoans left...
Wed 28 Mar 07 3:38 pm

We are trying to publish a simple Web Part using Visual Studio on Server 2003 running MOSS 07 locally. Our URL to our site is http://sp2007 and opens fine in a browser. We can not however get the site to deploy with the error - "No SharePoint Site exists at the specified URL". Any ideas on how we can fix this problem?

Thanks!


Tag Related Posts

So I'm in the LA Times ;)

Wed 27 Aug 08 2:51 P GMT-05
tags:                  

NYC SharePoint Developer Needed

Mon 12 May 08 12:09 P GMT-05

I got on the endcap baby!

Sun 10 Jun 07 1:06 A GMT-05
tags:      

Installing Orcas Beta 1 - VMware Style

Mon 23 Apr 07 12:16 P GMT-05

Orcas Beta 1 Released

Fri 20 Apr 07 7:09 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

Will Silverlight be DOA?

Mon 16 Apr 07 8:02 P GMT-05

My Little Pony .NET Unleashed 2007

Fri 30 Mar 07 1:59 P GMT-05

An experience with the Leopard beta

Mon 26 Mar 07 7:45 P GMT-05
tags:                

Authorness

Thu 15 Mar 07 1:44 P GMT-05

Tech-Ed 2006 Day 1 - Registration Day

Sun 11 Jun 06 7:17 P GMT-05

Lambda Lambda Lambda

Sun 21 May 06 1:01 A GMT-05

The Adventures of LINQ (Not Zelda)

Fri 19 May 06 11:21 P GMT-05
tags: