Tuesday, December 01, 2009

WSPBuilder 2010 Beta

I have been working hard for some time now getting WSPBuilder ready for SharePoint 2010 and Visual Studio 2010. The current status is that WSPBuilder now supports fully the new functionality of the wsp package introduced in SharePoint 2010. Also the WSPBuilder Extension for Visual Studio has been undergoing a major overhaul. Especially the Visual Studio Project/Item templates are currently totally rewritten and new templates will be added with new functionality.

Visual Designer is now supported in WSPBuilder 2010 projects. This means that you will able edit your pages (aspx) and user controls (ascx) with the visual designer in Visual Studio. The reason for this is because the WSPBuilder 2010 project template in Visual Studio is now based on the C# WebApplication project template.
However the special folder types for the Web Application template are not supported and are therefore not added to the project on creation and will have no effect if added later.

Visual Web Part are now available.

Backward compatibility with "old" software like SharePoint 2007 and the previous versions of Visual Studio are very important in the WSPBuilder project. Therefore WSPBuilder 2010 will still fully support SharePoint 2007 and Visual Studio 2005 and 2008. Furthermore I was able to keep it all in one installation file regardless of what system you have x86, x86 / SP2007, SP2010 / VS2005, VS2008, 2010, without going on compromise on the functionality. This simply means one installation file fits them 'all.

One major change that have been done in WSPBuilder 2010, is the change of 12 hive folder name. It will from now on be called "SharePointRoot" according to the official announcement. The old "12" folder is still supported as normal; actually there is no difference between 12 and SharePointRoot regarding functionality in WSPBuilder. But SharePointRoot is less confusing when targeting SharePoint 2010.

SharePointRoot is the new "12" folder.

Now that WSPBuilder 2010 is able to build both SharePoint 2007 and 2010 packages, it will in the build process display a compatibility statement telling the develop if SharePoint 2007 are still supported or not.

Solution compatibility tells you what version of SharePoint this package is compatibel with and the picture show that only SharePoint 2010 is supported.

So when will WSPBuilder 2010 be done?
To quote Blizzard "It's done when it's done!" I'll try to make every beta as much a complete version before releasing it. Currently there are no plans for major changes in the project structure for WSPBuilder, only more functionality and addons.

New features of WSPBuilder 2010

* Fully supports SharePoint 2010 Beta 2.
* Fully supports SharePoint 2007.
* Manifest.config introduced for managing new functionality of the SharePoint 2010 WSP package schema.

New features of WSPBuilder Extensions 2010
 * Support for Visual Studio 2010 Beta 2.
* Backward support for Visual Studio 2005 and 2008.
* Visual Studio Visual designer supported.
* No need to install Extensions to open the project in Visual Studio.
* Pages and user controls designer editing are now supported.
* Item template "Visual Web Part" has been added.
* Web Part will have custom code added if selected, removing the web part on feature deactivate.

Plans for new features in WSPBuilder Extensions 2010
(have not been implemented yet!)

* WSP import project template in Visual Studio.
* Delegate Control item template.
* Layout Page item template.
* New Wizard system for Item templates.
* ...and other item templates.

Only Visual Studio 2010 Beta 2 is supported. There are no plans to support beta 1.

Known bugs in the Beta 1.2
Workflow templates in Visual Studio do not work properly.

Please look on codeplex under Download. It’s the last file of the 4 available.


Sunday, November 15, 2009

SharePoint Manager 2010 Release

My good friend and colleague Anders Dissing that has taken over the SharePoint Manager project has now released a SharePoint Manager 2010 version on codeplex!

Anders blog on: SharePoint Manager 2010 Release

Download here!

SharePoint 2010 and WSPBuilder

A lot of people at the SPC2009 conference asked me about the future of WSPBuilder. Facts are that SharePoint 2010 is under way and the new SharePoint tools for Visual Studio 2010 are going to replace VSeWSS.

Here some conclusions from the SPC2009 conference.

  1. SharePoint tools for Visual Studio 2010 will only support SharePoint 2010.
  2. SharePoint tools will only support Visual Studio 2010.
  3. Currently there will be NO new tools for SharePoint 2007 and Visual Studio 2008 (except for the version of VSeWSS 1.3)

This means that all the current solutions out there for SharePoint 2007 will still need to depend on a 3rd party tool to get the job done.

Regarding WSPBuilder, a new version will be release to support the new possibilities in the WSP package for SharePoint 2010. The new version will still provide support for SharePoint 2007 packages, so bug fixes and added functionality will also be available for old 2007 projects. I plan for that WSPBuilder Extensions will support 3 versions of Visual Studio 2005 / 2008 / 2010 in one MSI packaged.

So WSPBuilder will still be around for a couple more years to support SharePoint 2007. Only time will tell if it will be popular for SharePoint 2010.

Wednesday, September 02, 2009

TOZIT SharePoint Discussion Forum solution for WSS 3.0 and MOSS 2007

Tobias Zimmergren has just released this awesome SharePoint Discussion Forum for SharePoint. Check it out!

Saturday, August 22, 2009

SharePoint Saturday Presentation in Copenhagen

From my presentation of Building WSP Packages Efficiently (schedule), the PowerPoint presentation and Visual Studio Project can be found below.



Monday, August 03, 2009

WSPBuilder Extensions ver. 1.0.6 - (WSPBuilder Version:

Some new updates have been made for WSPBuilder...

  • A Reference folder under GAC and 80/Bin is now supported for large dlls that do not need reflection for SafeControls and Permissions.
  • New menu function "Recycle the Windows SharePoint Services Timer" implemented on WSPBuilder Extensions.
  • Refactoring of "Copy to GAC" in order to improve the functionality.
  • Bug fixed! "Unable to get solution id from manifest: Unable to extract manifest.xml ..." error for x64 systems.
  • CabLib.dll updated to new version 10.5.
  • Its now possible to include the Cablib.dll into the WSP package.

The “Reference” folder

One of the new features of WSPBuilder, is the possiblility to add assemblies to the wsp package without getting them reflected upon. This means that there will not be created any safecontrols tags or permission policies for the assemblies. This will improve wsp build speed greatly for very large assemblies. So when you have some 3rd party assemblies that you would like to include into your wsp package, just add the 3rd party assemblies to a “Reference” folder under the GAC folder or 80\bin folder.

Project folder







As showing in the folder structure above, the SomeVeryLarge.DLL is located under the Reference folder and will therefore be included into the wsp package (and manifest.xml) but not reflected upon. This will greatly reduce the time needed to build the wsp package. However if there are UI controls in the SomeVeryLarge.DLL that will be used, you are forced to add it directly under GAC or 80\bin so the SafeControls tags can be created and added to the web.config otherwise you will get a security error. The MyOwnSmall.DLL is located directly under the GAC folder and therefore is reflected upon as normal.

Warning: There will not be created any security policies for the DLL’s in the “80\bin\Reference” folder, so you will need to manually change the policy settings in the SharePoint configuration files to allow the reference assemblies to be used from the 80\bin folder. When using the “GAC\Reference” folder, the assembly will be deployed to the Global Assembly Cache and therefore automatically be fully trusted.

Recycle the Windows SharePoint Services Timer

A new function in the WSPBuilder Visual Studio context menu have been added. This will recycle the Windows SharePoint Services Timer. (OWSTimer service). This function is intented to be used when developing SPTimerJobs, so you quicly can redeploy to GAC and recycle the Timer service from Visual Studio when testing.

Manually modifing the Manifest.xml

I had some request about being able to modify the manifest.xml and DDF file before building the wsp package. But the idea of WSPBuilder is that this should not be necessary. You should be able to do everything you need by use of the folder structure and wspbuilder.config file. But maybe I have missed something, so I would to hear from you if you have any case where you need to modify the manifest.xml file. Please e-mail me on carsten@keutmann.dk


Monday, June 22, 2009

Beginning SharePoint Development (Bonus part #3 WSPBuilder overview)

Bjørn Furuknap has done a great video on how to get starting with WSPBuilder Extensions. In the demo he shows how to replace the Cablib.dll file with a 32 bit version. This is because of a bug in the installer installing the wrong version. However now it has been fixed and it's no longer necessary to replace the file.. New version here WSPBuilder.

Bjørn Furuknap WSPBuilder demo...


Thursday, April 16, 2009

Disable Loopback Checking on Windows Server 2003

I updated my Windows Server 2003 running on a VMware image with the lasted April 2009 updates from Microsoft this morning. The result was that none of my SharePoint sites worked afterwards. The solution for me and one of my colleagues turns out to be this old known issue

I would only recommend to disable the Loopback checking for developing environments.

Disable Loopback Checking

  1. open regedit
  2. Find HKLM\System\CurrentControlSet\Control\Lsa
  3. Create a new DWORD value called DisableLoopbackCheck and give it a value of 1
  4. Restart the computer

Tuesday, April 14, 2009

Developers 10 Commandments for preventing errors

Over the years of programming, I have gone from a simple spaghetti developer to an object oriented, method mineralized, property loving, defensive coding and structure focused (spaghetti) developer. So what is the difference? When I think about it, my code may look like a spaghetti program today, for the untrained eye that is, because of object inheritance, events, properties and so forth. But it's much better organized than it was just 20 years ago. The big advantage is that it is much easier to spot and avoid errors than in the good old spaghetti programming days. But I still need to avoid programmatic and logic errors, therefore I follow these 10 basic commandments in writing code.

  1. Assumptions are the mother of all errors.
  2. The most lacy developer do things right the first time.
  3. If something can go wrong, then it will at some point do.
  4. Never implement bad exception handling. Like the Ostrich-algorithm, where you put your head in the ground and pretend that nothing has happened.
  5. Know your events or you program will fail.
  6. Errors usually appears where you least expect them to.
  7. Users come from the dark side and they got errors with them.
  8. Unit test... unit what?
  9. Keep it simple! However this does not apply for the female developers, they are able to multi task!
  10. Always include a dead-man switch in a While loop, if it potentially can loop forever.

You will find some of the commandments more relevant than others but they all still holds an important message.

Defensive programming (link)

When using a defensive programming strategy and following the commandments I tend to think what can go wrong in my code and how to prevent it from doing so or simply handling it. This turns into rock solid applications that help me sleep better at night. The effort required is actually less than that of the ordinary "spaghetti code", because you don't spend the time constantly debugging your code in the end when the users keeps coming back with new errors that they have found.

Three strikes and you're program is out.

In the beginning when a user first starts to use a program, they have the stomach for three errors before they tend to give up on it and look for another solution. Therefore it's very important that the users are not presented with the errors directly in the face every time something goes wrong. Fallback gracefully when an error occurs is very important so the users don't feel abandoned.

Detailed description of the commandments.

  1. Assumptions are the mother of all errors.
    Picked up from the movie Under Siege 2: Dark Territory (1995), where one of the bad henchmen (Penn) believes that he has killed Casey Ryback (played by Steven Seagal), but it's just an assumption and therefore Ryback is able to continue haunting the bad guys and finally finishing them off (think of yourself as one of the bad guys :-) The same thing applies to code - when you assume something will work, it will for sure come back to haunt you. (Nobody wants a Ryback running around and destroying their program). Every error in a program is there because the developer assumed that it was fine there was no possible scenario for an error. Don't make assumptions – know for sure and handle any possible outcome!

  2. The most lacy developer do things right the first time.
    If you want to save time and errors when creating a program, do things right the first time. Otherwise you just end up forgetting that you have skipped a step here, cut a corner there, so on and so forth. Yet again resulting in an error when you least except it.

  3. If something can go wrong, it will at some point do.
    This is a universal rule (another variant). Don't try ignoring it. The only thing is to make sure that nothing can go wrong. However even the best developers cannot avoid all errors therefore contain the error so it will not affect the outside world and implement a graceful fallback error handling routine.

  4. Never implement bad exception handling. Like the Ostrich-algorithm, where you put your head in the ground and pretend that nothing has happened.
    This is a common error handling that I have seen in various places, where the developer knows that something can go wrong, but is too lazy to implement a descent error handling logic. Thereby resulting in a possible unstable program. This happened to me once when another developer in my team made an empty try catch statement around a database call. When the call to the database failed - and it did happen from time to time - the code simply just continued like nothing had happened, resulting in that the database data became invalid. So I had to spend 2 full days debugging the entire code in order to find out why the program was unstable and not knowing where the error prune part was hiding.

  5. Know your events or you program will fail.
    This is one of the most important things you can do when coding in object oriented languages. Know in what order things happen in. I have seen a lot of developers writing a lot of bad code in ASP.NET because they simply haven't allowed themselves the time to study how a Page lifecycle works.

  6. Errors usually appears where you least expect them to.
    This is another law of the Universe. You might as well accept it!
    If you ever think a certain situation will never occur, you are properly wrong. I have heard this so many times "This will never happen… yada yada yada" – but trust me, it will! So always implement at least a minimal form of error handling.

  7. Users come from the dark side and they got errors with them.
    No developer can foresee every possible outcome of a program and users have the tendency to pick out the situations that you had never have thought of. So always think of in general error handling, so you can say to yourself… "Whatever happens, I have covered it."

  8. Unit test... unit what?
    This is an important thing to remember, especially when doing a lot of backend logic. There has been written a lot of topics on this subject and therefore I will not cover it here.

  9. Keep it simple! However this does not apply for the female developers, they are able to multi task!
    Male developers tend to develop programs with their forehead. This puts a constraint on how many of lines of code that they can handle simultaneously. Males like giant things, but giant methods are a bad thing. It is easy to lose overview of what is going on in the method with too many lines of code and therefore the possibility for errors sneaking in is greater. Keep your methods at a minimum, even if they are just used once in a call from one other method.

  10. Always include a dead-man switch in a While loop, if it potentially can loop forever.
    All developers in world has made this one at least once in their lifetime. Creating a While statement but forgets that they can potentially run forever and it stalls the process. So if there is even the slightest chance that a While statement can loop beyond its intention, introduce a dead-man switch. A simple counter that can only count to a certain amount before ending the while loop.

This more or less concludes my 10 commandments. Read it, learn from it and hopefully improve on it.

Monday, April 13, 2009

WSPBuilder documentation

I know that the documentation on using the WSPBuilder hasn't been fulfilling to say it nicely, but that's the way it is.

The good thing is that other people have been nice and done some work on this. This is what I have found so far (in random order), sorry if have forgot someone.

WSPBuilder - Walkthrough of the Visual Studio Add-in

WSS: Development - Quick Start with WSPBuilder

WSS Dev: WSPBuilder Templates

WSS Dev: HowTo debug a WebPart

Change the WSPBuilder DeploymentTarget to WebApplication

Intro to WSPBuilder

WSPBuilder Folder Structure

Developing SharePoint Solutions in Visual Studio

TFS Build and WSPBuilder

How to get TFS to automate your WSP builds with WSPBuilder

The WSPBuilser Manual

My Blog.

New! (2009/08/02)

Creating a code-only webpart and deploying as a feature

Please comment with more links if you know one.

Friday, April 10, 2009

WSPBuilder - Walkthrough of the Visual Studio Add-in

I know that there are not much documentation on how to use WSPBuilder in the install package, but my good friend Tobias Zimmergren have written a great post on SharePoint development with WSPBuilder Extensions. Check it out. http://www.zimmergren.net/archive/2009/04/08/wspbuilder-walkthrough-of-the-visual-studio-add-in.aspx

WSPBuilder Extensions 1.0.5

This version of WSPBuilder Extensions 1.0.5 now fully supports development on an x64 bit systems and Windows Server 2008.

Installs correct CABLIB.DLL for x64 systems. (No need for manually installing)
"Copy to 12 hive" function now works on x64 systems.
Support for IIS7
Minor bug fix for "Recycle App Pools"
Supports VisualBasic Project/Item templates. (Thanks to Chip Sockwell)
wspbuilder.exe is included in this package.

Install notes.:
Be sure to uninstall the old version of WSPBuilder Extensions before installing the new version.

Happy SharePoint coding folks


Thursday, March 12, 2009

Visual Basic Project/Item template support in WSPBuilder Extensions 1.0.4

Thanks to Chip Sockwell and his work on converting the C# templates to Visual Basic. You are now able to create Visual Basic projects with WSPBuilder templates in Visual Studio.

However if you are only using C#, you do not need to install the new version (1.0.4).

Get it here: WSPBuilder.com


Thursday, February 05, 2009

SharePoint Manager 2007 ver

I have done some work on SPM2007 and implemented a new language Swedish. (Thanks to Andreas Kviby for the translation)

- Warning on deletion has now been implemented.
- Icons for nodes updated.
- Dutch and Swedish languages implemented.
- Groups and Roles on the Site is now browsable.

Get it on codeplex.

Have fun :)

Friday, January 30, 2009

SharePoint MVP

Oh .. by the way.. I have become a SharePoint MVP.