How to get the Build tasks working in your project

The build tasks work on any Visual Studio 2005 or 2008 project type, but for best results use a Class Library for development of any code, and add the physical files that need deploying into subfolders within this project. (Just as in the image on the home page)

Step 1

Create a new folder in the root of your project called BuildTasks

Step 2

Copy the following files into the new folder created in Step 1 and save the project
* CabDotNet.dll
* ExampleUsage.proj
* Starznet.MSBuild.SharePoint.tasks
* Starznet.MSBuild.SharePoint.Tasks.dll

Step 3

Right click on the project in Visual Studio and select Unload Project

Step 4

Right click on the project (now greyed out) and select Edit NAMEOFYOUR_PROJECT.csproj (or .vbproj etc). This opens the actual project XML file

Step 5

Add the following line to the project file just before the <ItemGroup> tag. The name of the .proj file below should match the one in the BuildTasks folder created in Step 1
<Import Project="ExampleUsage.proj" /> 

Step 6

Add the following line to the end of the project file
<Target Name="AfterBuild">
    <CallTarget Targets="SharePointBuild" />
</Target>

You may notice that the <Target Name="AfterBuild"> tag is currently commented out if this is the case then uncomment it and add the
<CallTarget Targets="SharePointBuild" />

This line will ensure that this MSBuild project file will be executed after the build of the main assembly.

Last edited Jun 19, 2008 at 1:24 PM by Starznet, version 9

Comments

No comments yet.