SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Sharepoint Team Development with Visual Studio 2005 2008 Part 2

This is the second part of Sharepoint Development using Visual Studio series. For previous part:
http://www.sharepointblogs.com/tommysegoro/archive/2008/09/04/sharepoint-team-development-with-visual-studio-part-1.aspx

 

INTRODUCTION

I've shared to you about the type of projects and the development methodology approach on my previous post. I really-really thank everyone who has contributed and spending their time writing comment on my previous post. Thank you for your sharing!

This second part I will talk about planning the development. Once again this is all based on my previous experience only so any comments/sharing from you will be much much appreciated! I always believe that there is sky above sky and I always believe that there is no one who can do everything...some people are good at one thing and another people good at other things. So please write comments, please share, please disagree or agree with me. Thank you very much.

 

THE REQUIREMENTS GATHERING

This is what I found as the biggest part of the development process: the planning. In my experience the planning will decide how your development process is going to be. It can be easy or it can be nightmare. The first planning we have to do before start developing on Sharepoint is to GET THE CONTENT TYPES AND FIELDS RIGHT. I always do this as my first step. The reason is, as someone pointed in my post regarding updating content types and fields, Microsoft only supports limited method of updating fields. Please read it here.

I've ever developed a MOSS website for a government body that has more than 20 content types and more than 100 custom fields! And yes...we didn't get them right in the first place and the manager pushed us (the poor developers) to make the system available in UAT so that client can START INPUTTING CONTENT!. This is WRONG WRONG WRONG....at the end of the day, we wasted so much time updating the fields because we didn't get them right in the first time. We ended up changing some fields from Text to HTML because they need more than 255 characters of content in that particular field, etc. It was pretty bad....

In a modern development methodology, Agile development allows you to not have the full set of requirements in the first place. Change requests are allowed and can be handled very well with this methodology. However, with content types and fields, for me personally (at least from my experience), they have to be done right in the first place. Additional fields are OK because when you de-activate/re-activate feature, they will be added successfully. But changing field types, etc will be very hard for existing fields.

The other part of Sharepoint (custom controls, master pages, site definitions, event receiver, feature receiver, workflows, etc) can be updated quiet easily using feature/solution deployment. So with these, you can apply Agile methodology (ie. You don't have to get the design right in the first time for you to be able to write custom controls, do you?).

 

THE PROCESS

1. You should define your content types and fields first
2. You should NEVER get users/clients to put live content before the fields and content types are done correctly. This should be done after the content types and fields are finalised. This will just screw your project plan because as I've mentioned earlier, modifying existing content types and fields are just so hard and we don't want to re-flush the site (ie. delete/re-create site collection) and re-activates the new fields and content types and lose the live content thas has been put in the test site, do we?
3. Other Sharepoint elements (master pages, page layouts, DLLs, etc) can be developed ad-hoc. You don't need to get them right on the first time. They can always be upgraded with solution/features easily.

 

THE TOOLS

As I mention earlier in my first post, we HAVE TO USE feature and solutions deployment and thanks to everyone who contributed about the workflow deployment. Yes, it's the best practice to deploy everything (including workflows) using feature and solution deployment. Therefore, we will need a tool that enables us to do this especially for doing it from Visual Studio.

The tools that I mention in this blog are once again based on my experience only! Of course you must have other methodologies for creating features and solutions automatically. The tools I will be using are (including their advantages and disadvantages which are also only my opinions, you can disagree/agree with me):

STSDEV

Advantages
- Built-in Visual Studio build commands. You can run install, deploy, upgrade, delete, etc from Visual Studio directly. Just build your project and it will do the job for you. You don't need to open command prompts and remembering the lines!
- Auto-creation of manifest.xml and DDF files and auto-creation of CAB/WSP file which is great.
- If you remove files/folders from RootFiles, they will be reflected straight away in manifest.xml, DDF and WSP.

Disadvantages
- You have to use the project type selector for creating a particular project. I tried to use the Blank Solution without DLL (C#) project before for creating features and guess what...somehow the files within the feature (except feature.xml and elements.xml) are not deployed! They're in the CAB and WSP but they're just not deployed to the FEATURE directory. Maybe I didn't do it right but anyway...one thing that I'm hoping STSDEV can be improved is it should be generic for ALL type of Sharepoint projects (regardless it's web part, feature, etc). The project selector will only create a set of files/folders inside RootFiles for a particular project so user will not forget. For example, if I select the Web-Part project, the project selector should create folders and files required to deploy a web-part. It should not fail if the web-part project is used to create features.
- Inclusion of DLLs are manual. If you add a reference to another project that will add a referenced DLL, you have to specify it in SolutionConfig.xml manually.
- It creates one Visual Studio solution per project. Additional configuration will be required for you to be able to aggregate STSDEV projects into one solution.
- You cannot control the creation of the DDF file. At the moment I found a problem where you can't set the .Set MaxDiskFile property of the DDF which will allow the CAB file to be bigger than 1424KB. Therefore, if you have so many files in your CAB file and it exceeds 1424KB, they will be truncated. The work around for this is to let STSDEV build the DDF, you set the MaxDiskFile property manually then you build the CAB manually and not using STSDEV.

GERALD DE RUN (Microsoft consultant)'s SOLUTION TEMPLATE

I've met him before in my previous workplace and he introduced to us his solution template. Please read his blog here. His solution template is utilising POST BUILD event to create manifest.xml, DDF and WSP.

Advantages
- The template is generic for everything (web part, features, etc) and the files will be deployed successfully in FEATURE folder.
- Has built-in Install.cmd, Upgrade.cmd and Uninstall.cmd.
- Can aggregate many projects into one solution.
- A switch in post-build event will allow you to add all referenced DLLs to the deployment project (hence in WSP) automatically.

Disadvantages
- No Visual Studio built-in commands. So you have to open command prompt and run the script
- Since it's using 2 projects, one is the deployment project and one is development project, the way it works is, it will copy the files from development project to the deployment project using post-build events then in the deployment project, there is another set of post-build events and scripts that will then create manifest.xml, DDF and WSP. With this configuration, the files are not automatically deleted from the deployment project. If you remove files/folders from the development project, the removal from deployment project is manual. So you have to create a custom tool (which I have done) that will allow you to delete files/folders from deployment project hence removing them from the WSP.

I personally go down Gerald De Run's path and modify his solution template to be Tommy Segoro's solution template that has some fixes to some of its limitations. There is no reason at all for me for not using STSDEV. Why I use Gerald's solution template, because I knew about it before STSDEV (hence comfort zone).

My point is, it's not important about what tools you're using as long as creation of manifest.xml, DDF and WSPs are automated. If you've used STSDEV please continue using it. It's an excellent product! If you're still interested with my modified-Gerald-De-Run's solution template, please go to http://www.sharepointblogs.com/tommysegoro/archive/2008/09/12/visual-studio-2008-sharepoint-solution-template.aspx.

 

CONCLUSION

So there you go....remember, get the content types and fields right first before you get into trouble.


Posted 09-08-2008 9:28 AM by tommysegoro

Comments

Håvard wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-08-2008 12:56 AM

Have you tried wspbuilder?

tommysegoro wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-08-2008 1:40 AM

No I haven't actually. Is it good?

Aapo Laakkonen wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-08-2008 12:49 PM

> GET THE CONTENT TYPES AND FIELDS RIGHT

Well, the problems lies in that with many content types it's impossible to get them right. Business rules do change, customer wants new features etc. One way is to write initial version and let the customer modify content types from SharePoint UI (or you can do it for them with UI, and forget packaging any changes or putting them in VCS).

Yes, I really think that MS has fu*ked up with this. I really hate that the lists do make copy of content types. That should have never been implemented. The other way is to let Microsoft fix this and forget the content types and site columns until then (but then we won't get the nice search features that we get with content types).

Yes, I share your pain. And what about the developer tools? MS extensions for SharePoint? What a joke is that? Well, I have build my own msbuild task to take care of building wsps and manifests (I do not need ddfs, because I use unmanaged cabinet.dll directly).

SharePoint is a mixed package. On the other hand you can do some nice things with it easily, but in many ways it's pain in a developer's ass.

tommysegoro wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-08-2008 7:22 PM

Thank you Aapo for your sharing. Yes I know requirements will change however if we can get the first-phase content types done correctly in the beginning we save a lot of time upfront. But yes...maintenance of Sharepoint can be a nightmare when it comes to content type/fields modifications.

Hopefully MS fixes this in  the next version. Thanks mate.

Ravi Kumar wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-09-2008 12:01 AM

Hello Tommy, I am new to MOSS.. Please share your tool so that I can use it. Also please tell me how I can use this template to deploy the solution to a farm environment

Ravi Kumar wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-09-2008 12:02 AM

Waiting for your tool. Please tell how this tool can be used for deployment in a farm environment

tommysegoro wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 09-09-2008 12:08 AM

Hi Ravi,

I will share the tool with you. With farm deployment it's very easy. When you deploy your solution, Sharepoint timer will replicate those deployment into the other servers.

So when you want to deploy a master page file for example, you deploy the solution then Sharepoint timer will then deploy the correct file to every server in the farm .Very easy....that's why solution deployment is the best practice.

Links (9/9/2008) « Steve Pietrek - Everything SharePoint wrote Links (9/9/2008) « Steve Pietrek - Everything SharePoint
on 09-09-2008 7:38 PM

Pingback from  Links (9/9/2008) « Steve Pietrek - Everything SharePoint

Tommy Segoro wrote Visual Studio 2008 Sharepoint Solution Template
on 09-12-2008 12:26 AM

INTRODUCTION In relation to my Team Development posts, www.sharepointblogs.com/.../archive

Tommy Segoro wrote Sharepoint Solution Syntax Part 1
on 09-14-2008 10:07 AM

INTRODUCTION In my previous posts: - Visual Studio 2008 Sharepoint Solution Template http://www.sharepointblogs

wordpress themes for free wrote wordpress themes for free
on 10-13-2008 9:19 AM

I love wordpress! Its not only a software for blogging. Its a full content-management-system. I personally like it more than typo3! :-)

playstation xbox games » Blog Archive » Visual Studio 2008 Sharepoint Solution Template wrote playstation xbox games » Blog Archive » Visual Studio 2008 Sharepoint Solution Template
on 10-22-2008 12:29 AM

Pingback from  playstation xbox games  » Blog Archive   » Visual Studio 2008 Sharepoint Solution Template

Fellowes Shredder wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 10-28-2008 1:19 AM

Fellowes paper Shredder, A brand with quality offering a high range of Shredders, Paper Shredders, Industrial Shredders, Personal Shredders, Executive Shredders; shredding your papers in stripcuts using stripcut shredders,crosscuts using crosscut shredders.

Anthony Grace wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 12-03-2008 10:05 AM

Has anyone noticed that STSDEV crashes when creating a Web Part using VS 2008 on W2K8. Apparently other people are reporting the problem on CodePlex...

Paper Shredder wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 12-29-2008 12:41 AM

I think a lot of organizations are exploring new ways to become more cost efficient these days. Many big companies often use large amounts of paper in their everyday environments.So they need a paper shredders because Paper shredders are a simple solution to destroying many of the documents and materials that hold private information.Taking simple steps, such as purchasing a paper shredder, can help you avoid a lot of pain and suffering in the future. That seems well worth the small investment.Wanted to compliment on your site, it looks really good.

Haitham wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 01-04-2009 11:57 AM

Can i do everything from inside the solution file without the need to do anything from SharePoint administration UI?

i mean, when i finish the development phase will i be able to install the application to the customer environment using the generated WSP file only or i will have to do some extra modifications using the SharePoint UI?

another questions about the content types, does the list copy the content type and doesn't reference it?,. so when i associate a list with a content type and later change this content type, it will not take effect on the list?

thanks

tommysegoro wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 01-04-2009 6:05 PM

Hi Haitham,

Yes you can just send the client the WSP file then they can install it themselves. You can do everything using WSP (client-Sharepoint-site wise) what I mean is things like setting master pages, installing content types, etc you can do it using the WSP. An example of this will be the CompleteSharepoint.NET application that I wrote www.completesharepoint.net as you can see, I can just simply send you the 3 WSP files and you can install the application yourself.

Regarding the content types, unfortunately lists copy the content types not reference them. Therefore, if you want to make changes to the copied content types, go to the Site Content Types (root level), make your changes to the selected content type, then go to Advanced Settings of the content type, then tick the "Update all content types inheriting from this type?" then click OK.

Hope this helps.

Tommy

Home Paper Shredder wrote re: Sharepoint Team Development with Visual Studio 2005 2008 Part 2
on 01-17-2009 4:30 AM

The multifacet use of shredder which has Convenient - feature Auto On/Off and reverse function to clear overloads.  Secure - Choose from straight-cut or higher security / bulk reducing cross-cut models.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.