Saturday, August 30, 2008

STSDEV: my favorite sharepoint devel tool
















In lots of sharepoint books you will find that features are the preferred packaging mechanism for Sharepoint components. The main and simple reason is that features are easy to activate within existing sites and also have object and event models that are very powerful. A feature can be activated with WSS sites in many ways:
  • through the Site Settings Web pages
  • with STSADM command line
  • site definition references
  • feature activation dependencies
  • feature stapling
The standard way to deliver a feature is building a wsp file. When building features using VS2008 or VS2005 you have lots of options for using different tools:
STSDEV is the most flexible and easy to customize. It is using MSBuild. Unfortunately I did find one bugs which is annoying enough :
  • Can't be used with solutions added to SVN --> thanx for comment, indeed starting from Change Set 12816, it is possible now to used it under SVN

Event handler is not trigged from console app.

A few days ago when try to test an event handler, I've build a simple console app. and add from code an item to a list. Surprise ! ItemAdded() was not called. So I'd write an email to some sharepoint gurus.
Here is the content of the email send by me to Robert L. Bogue :

Hello Robert,

Thanx for great posts about sharepoint. I do have a simple problem. I build a simple console app:

        static void Main(string[] args)
{
using (SPSite site = new SPSite("http://ovidiubeches/"))
{
using (SPWeb web = site.OpenWeb("dt"))
{
web.AllowUnsafeUpdates = true;

SPList list = web.Lists["Tasks"];
SPListItem item = list.Items.Add();
item["Title"] = "new item " + DateTime.Now.ToString();
item.Update();

web.AllowUnsafeUpdates = false;
}
}
}

THE PROBLEM is that when item is added from console app the ItemAdded() event hanlder is not called, but when item is added from browser everything works perfect. What is the explanation ? Any solution to that except using web services from console app ?
I usual need console app to add / edit items for testing. Sometime I do have fields that are hiddend or too complex to populate them by hand. So any sugestion to this will be great !

Many thanx,

Ovidiu B E C H E S - P U I A
Software Developer


After 2 days I've got the reply from him:

I wish I could tell you what's going on -- but I don't know. I'd post something in the forums. More people are looking at that stuff -- including some MS folks paid to respond.

Rob

-------------------
Robert L. Bogue, MS MVP: Microsoft Office SharePoint Server, MCSE, MCSA:Security, etc.
Blog: http://www.thorprojects.com/blog
Have you heard about The SharePoint Shepherd's Guide for End Users? Learn more at http://www.sharepointshepherd.com/


So this seems to be a tough problem ... do you have a better answer to my problem ?



Thursday, August 21, 2008

My favourite sharepoint book ever


After 6 months of sharepoint developing custom solutions, I came up with the conclusion that my favorite book is

Inside Microsoft Windows SharePoint Services 3.0

so I recommend it from the bottom of my heart to all newbies who want start learning sharepoint developing. I can assure you that inside it you will find 90% of solutions that you will fact as a sharepoint developer.

For code inside it check http://www.tedpattison.com/Don't leave that site without go to Download section. There are great great examples that you wont find easy on other place on net. Trust me !