Creating a Visual Studio Project for Windows SharePoint Services 3.0
Visual How To

Applies to: Microsoft Windows SharePoint Services 3.0, Microsoft Office SharePoint Server 2007, Microsoft Visual Studio 2005

Ted Pattison, Ted Pattison Group

May 2007

Overview

Development for Microsoft Windows SharePoint Services 3.0 often involves deploying custom source files into the WSS \TEMPLATE directory. It is helpful to create a Microsoft Visual Studio project with a directory structure that parallels the \TEMPLATE directory so you can automate copying your source files into the location required for deployment and testing.

Code It

Create a Visual Studio project by using the Class Library DLL project type. Next, create a \TEMPLATE directory inside the project. If you are creating one or more features, create a FEATURES directory inside the TEMPLATE directory and add your feature source files. If you are creating custom application pages, create a LAYOUTS directory. Within the LAYOUTS directory, create either a company-specific or project-specific directory and create your custom application pages inside it.

Create Visual Studio Project For SharePoint

Figure 1. Your Visual Studio project with a directory structure parallel to the WSS\TEMPLATE directory

Deployment

After you create the source files for components such as Features and application pages, create a batch file to automate copying these files into the \TEMPLATE directory. If you are testing a Feature, the batch file must also make calls to the STSADM.EXE command-line utility to install (and possibly activate) the Feature. If your solution contains an assembly that must be installed in the global assembly cache (GAC), your batch must also run a command with the utility named GACUTIL.EXE. Here is an example of a batch file that involves all these aspects of deployment for testing purposes.

@SET TEMPLATEDIR="c:\program files\common files\microsoft shared\
                  web server extensions\12\Template"
@SET STSADM="c:\program files\common files\microsoft shared\
             web server extensions\12\bin\stsadm"
@SET GACUTIL="c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\
              Bin\gacutil.exe"

Echo Installing HelloWssDev.dll in GAC
%GACUTIL% -if bin\debug\HelloWssDev.dll

Echo Copying files to TEMPLATE directory
xcopy /e /y TEMPLATE\* %TEMPLATEDIR%

Echo Installing feature
%STSADM% -o installfeature -filename  HelloWssDev\feature.xml -force

REM - Uncomment next line when you need to restart IIS worker process
REM IISRESET

Notice that the three file paths at the beginning of this batch file contain line breaks to make them more readable in this document. However, be sure to remove these line breaks inside the actual install.bat file so that it works properly.

Post Build Events

The next step is to add a post-build event to your Visual Studio project so that it runs install.bat at the end of the build process. Notice that you also must change the current directory seen by install.bat to the current project directory. Here is what your post-build event should resemble.

cd $(ProjectDir)
install.bat
Read It

Developing components for custom solutions for SharePoint Products and Technologies can provide a powerful way to extend Windows SharePoint Services and Microsoft Office SharePoint Server 2007. When you create a Visual Studio project to create these components, you should have a structured approach for testing and debugging. In particular, your project will contain one of more of the following types of components.

  • Feature files

  • Site definition files

  • Application pages

  • Page templates

  • Web Part description files

  • Assembly DLLs installed in either the GAC or the bin directory

When you create a Visual Studio project that automates copying source files into the proper location and installing Features and assembly DLLs, you can test and debug much more quickly.

See It Create Visual Studio Project

Watch the Video

Video Length: 00:11:20

File Size: 20.6 MB WMV

Explore It
Tags : deployment


Community Content

srikanthd
The video

Hi,

The video screen freezes if I pause the stream, however the audio continues. Can you fix the stream.

Thanks.

Tags :

Hariraj Singh
The Video Freezes

Hi

If i play the video without any pause in between the video still freezes, though the audio could be heared.

Can i have a link to download the Video insted.

Thanks.

Tags :

Noelle Mallory - MSFT
SharePoint Server is exciting

Hi,

Go with the previous comments given about video streaming. Not working properly, although video seems usefull.

Moreover where can we find all the videos related with SharePoint Server 2007 and the Visual Studio Developement for SharePoint applications/workflows.

I have few questions

1. Can we hide specific columns in a document libraries according to the user accessibility rights. My requirement is to hide certains columns to some users and visible to others ?

2. Workflows starts within the MS Office follow which user heirarchy and how. Can we switch the user to follow the different heirarchy if some certain approval goes right or wrong ?

So far,

Thanks & Regards

[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.

Tags :

AnonymousToday
Follow up to project?

In the video the author talks about further development of this article.

Is it available, and if so where is it?

Tags :

Pankaj1089
Problem with the video
The video gets stop whereas the audio continue.
This is the problem with most of the 'Ted Pattison' videos.
Tags :

Shary
I don't get the feature in SharePoint site! What should I do?!

Hello,

I went through all the steps but at the end I don't have the feature under the Site Settings > Site Features list in SharePoint! What should I do?

In the feature.xml file for xmlns="" I don't have the SharePoint in the list,I just copyed xmlns="http://schemas.microsoft.com/sharepoint/ from your code!

is this the reason that I can't have the feature in sharepoint site???

Please help

Looking forward to receiving your prompt reply

Thanks

Tags :

Page view tracker