RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


SharePoint Applied: 10 Things You Wish They Had Told You—Part 2 : Page 2

Part 1 of this two-part article covered five architecture- and management-focused topics you wish they had told you about SharePoint. This article follows up with five more topics targeted specifically toward SharePoint developers.

3. Reverse-Engineering SharePoint
"Invention is the art of hiding the source of your inspiration."

When you see something interesting happen on a SharePoint web page, you may wonder how you could replicate that feature in your own sites. You could start poring through the documentation, ask your friends how to do it, or delegate it to your staff. But perhaps the best option is to cheat by peeking into SharePoint to find out how they did it!

I'd encourage you to cheat, guilt free, by using the following two methods:

  1. Peek into the SharePoint 12 folder, and look in the Templates\Features folder and see how certain features are written.
  2. When authoring a custom feature targeting list definitions, content types, or views, if you're struggling with the specific CAML syntax, create the list definition manually, and point your browser to the URL http://yoursiteurl/_vti_bin/owssvr.dll?Cmd=ExportList&List={YourListGUID}.
This second approach isn't perfect. Sometimes the CAML it produces may not validate with the schema, and the CAML structure it produces may not be production ready. But it serves as a perfectly good starting point to copy and paste pieces out of the generated XML, so you don't have to start at zero.

4. Fix that Annoying Web Part
There was a time when a bunch of Coke-bottle-glasses-wearing scientists pored over punch cards for hours before they dared put them into a computer. But computers are so much cheaper now that the standard development method has turned into:

  1. Write code.
  2. Throw at computer.
  3. See if it works.
  4. If it doesn't work, debug and fix on the fly. Go to #2.
  5. If it works, go home and play Tetris.
The problem is that a developer may sometimes throw in a Web Part that totally brings down the hosting page to such an extent that the page won't even run; you can't even see the "Edit" menu to remove the offending Web Part.

Luckily, there is a back door that lets you remove such Web Parts to fix the page. Simply go to the URL http:///_layouts/spcontnt.aspx?&url=. That page presents you with a menu to clean out these Web Parts from both shared and personal views.

5. Avoiding IISRESET
A fair criticism of SharePoint is how much it likes to make you run IISReset whenever you deploy new functionality. Now, in the real world it shouldn't matter much, because you can always schedule code deployments at the end of the day, and because your production web farm probably consists of more than one web server—you can update one while the others are running.

But in development, IISReset can get annoying. Every time you hit IISReset, you lose five seconds of your life. By the time you are 70, this will have added up to a few days lost.

A much quicker way is to recycle only the application pool instead of issuing an IISReset. To do that, you can use the following command:

   cscript c:\windows\system32\iisapp.vbs
      /a "[App_Pool_Name]" /r
A related issue is that every time you recycle either the application pool or issue an IISReset, the next request to SharePoint is extremely slow. That occurs because ASP.NET recompiles the web application. I like to include Spence Harbar's application recycle utility in my SharePoint virtual machines. I can use this tool to warm up my SharePoint URLs and precompile them, so when a user accesses them, they appear responsive and quick.

SharePoint for developers is a huge topic. There is plenty for a developer to learn—and do—in a SharePoint project. This article discussed only a few of the relatively important tips you might need.

Happy developing!

Sahil Malik Sahil Malik is a Microsoft MVP, INETA speaker, a .NET author, consultant and trainer, and a well-rounded overweight geek. He has a passion for SharePoint 2007, data access, and application architecture. Sahil loves interacting with fellow geeks in real time. His talks are full of humor and practical nuggets. His talks tend to be highly charged, fast moving, and highly interactive. Be sure to check out his blog.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date