Building Web Parts using VS.NET extensions for SharePoint



Mike McDonogh sent us this recommendation:


 


If any of you are planning on building web parts for Project Server 2007 I’d HIGHLY recommending using the VS.NET extensions for SharePoint.


 


http://www.microsoft.com/downloads/details.aspx?familyid=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&displaylang=en#Overview


 


The trick to get it working in VS.NET 2005 so that it will run in Project Server Sites is as follows:


 


1.    Create a new Web Part project


2.    Open the class and change the code System.Web.UI.WebControls.WebParts.WebPart to Microsoft.SharePoint.WebPartPages.WebPart


3.    Create a DWP file, Project Web Access site required a DWP file to be imported


<?xml version=”1.0″?>


<WebPart xmlns=”http://schemas.microsoft.com/WebPart/v2“>


   <Assembly>DynamicProjectRegistratonModule, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=99646028e7d67527</Assembly>


   <TypeName> DynamicProjectRegistratonModule.RegisterProjectWP</TypeName>


   <Title>Web part for registering new projects in Project Server</Title>


   <Description>You can put a description here.</Description>


</WebPart>


4.    Click deploy in Visual Studio.NET


 


Why would you want to use the extensions [huge time saver]:


 


·         Build the Web Part assembly.


·         Package the Web Part solution as a Windows SharePoint Services Feature.


·         If this Web Part solution was deployed previously, the extensions retract the previous version of the Web Part solution Feature.


·         Updates the web.config safe controls settings automatically.


·         Install your Web Part assembly to the global assembly cache.


·         Deploy and activate your Web Part solution Feature in Windows SharePoint Services.


·         Add your Web Part to the SafeControls list.


·         Restart Microsoft Internet Information Services (IIS) by invoking the iisreset command.


·         Attach to the w3wp processes to enable debugging.


·         Packaging for deployment to QA/DEV/Production in VS.NET is easy.

Comments (0)