Solution

The solution for warming up SharePoint

Most SharePoint Farms will have a solution for the long loading time after an Application Pool recycle or iisreset running. There are many different ways to preload websites, so your users have faster load times. So why another solution?

There are some questions, that I think have not been dealt with before:

  • Most solutions require some sort of Timer to be started (e.g. a Scheduled Task)
  • When should the warmup occur?
  • What about multiple WebFrontend Servers?
  • How about Claims support?
  • Which URLs have to be called? What about extended WebApplications?
  • New WebApplications require the warmup tool to be adjusted
  • Manuell warmup after Deployments
  • What about search?
  • Did the Farm warmup correctly?

Years ago I developed a console application, which warms up SharePoint by calling each Site within a SiteCollection. It has bee updated multiple times with new features.

When a Feature gets installed

Have you ever thought about the Features folder and when a folder will be created for one of you features? Well, I did 🙂

Why is this relevant, anyway? To be able to activate a feature on a given scope, it has to be installed first. That’s why.

  <td valign="top">
    <strong>Result</strong>
  </td>
</tr>

<tr>
  <td valign="top">
    stsadm -o addsolution
  </td>
  
  <td valign="top">
    The solution is added to the farm. Features are not available
  </td>
</tr>

<tr>
  <td valign="top">
    stsadm -o deploysolution
  </td>
  
  <td valign="top">
    Feature folders are created and the Features are available for activation
  </td>
</tr>

<tr>
  <td valign="top">
    stsadm -o installfeature
  </td>
  
  <td valign="top">
    A feature with ID xyz has already been installed in this farm.  Use the force attribute to explicitly re-install the feature.
  </td>
</tr>
Action

Great. After deploying the solution, the feature is automatically installed and can be used. I did expect this, because installing a feature is a rather uncommon task.

Activating Features after Solution Deployment via VS

Visual Studio allow a F5 Deployment. I guess you all know that. The part where you have to think carefully is, when you add Features to your project.

Should you activate “Activate On Default”? Well, it depends (as always). Usually I don’t enable that setting, because features tend to be activated on scopes you won’t expect.

The problem

Take a WebApplication scoped feature for example. It might create SafeControl entries for your controls. Do you really want them to be added to an Extranet WebApplication if your solution is solely for an Intranet Application?

Disable Loopback Check?

A while ago Microsoft released an update, which prevents that you can log on locally to a website which has a FQDN.

To resolve issues with e.g. the crawling a KB article has been published.

You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version

You can disable the loopback check completely, or just for the used FQDNs. This would be the better way.

Multi Level Navigation

The out-of-the-box WSS navigation offers one level of navigation. The navigation elements can be configured in the site settings.

There is a way to make it have multi level navigation, as MOSS does, by changing the DataSource. But this “hack” is not flexible, as you can not reorder the item within the navigation menu.

While I was reading the post How to create your own Cascading Navigation using the ASPMenu control, the decision was made to build a custom navigation which supports multiple navigation levels.

.NET 3.5 and Silverlight

Using AJAX or Silverlight from within SharePoint in Webparts requires you to modify the web.config to support the technology. I don’t mention that you have to install the .NET Framework 3.5 SP1 and Silverlight to be able to use it…

Instead of changing the web.config manually (.NET Framework 3.5 AJAX und Silverlight in SharePoint registrieren von Fabian Moritz), you can use my features. They do all the necessary changes for you. The Silverlight feature requires the .Net 3.5 feature.

Solution deployment fails

Deploying a SharePoint solution (.wsp file) to a SharePoint farm should be easy. Even if the farm contains 4 SharePoint Servers.

Just stsadm –o addsolution –filename solution.wsp. Some waiting so the deployment is done on every server, and we should be happy.

Well, the result was an Error in the solution status. Additionally the ULS log showed

Updating SPPersistedObject SolutionOperationStatus Name=SolutionOperationStatus Parent=SPSolutionLanguagePack Name=0. Version: -1 Ensure: 0, HashCode: 38896601, Id: 87c32e71-13f0-4d85-a215-29f1d180d239, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.Update()     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.SetOperationResult(SPSolutionOperationResult opResult, String msg, SPWebApplication webApp, Int32 updatesPerServer)     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.DeployFilesInstallFeatures(SPWebApplication webApp, Boolean globalInstallWPPackDlls, Boolean installFeatures, Boolean force, Int32 tries)     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.DeployLocalCore(Boolean globalInstallWPPackDlls, Collection`1 webAppl…

Upgrading a solution fails

In a SharePoint farm with multiple servers, features have to be deployed to every server. No problem you would think. That is why we got solutions and deploy them with stsadm. SharePoint will do the rest.

But what do you do if you got an error during the deployment process?
In my case the error was:

A deployment or retraction is already under way for the solution xyz, and only one deployment or retraction at a time is supported.

Cancel the activation of a SPFeature

If you have ever created a SPFeatureReceiver class, you might have noticed, that there is no “FeatureActivating”. So what do you do to cancel an activation of your feature?

Just throw an exception within FeatureActivated. This will cancel the activation process, and not activate the feature.

throw new SPException(“The feature could not be activated.");
Technorati Tags: ,

Installation, Deployment, Activation of Features

I get plenty of questions on how to add, deploy or activate a SharePoint Solution.

Solution

A SharePoint solution is a *.wsp file (which is a cab file) which contains at least one feature.

Feature

A feature adds new functionality to your SharePoint farm. It can be wrapped inside a solution file, or be deployed by adding files to your SharePoint servers.

Installing a Solution

To install a solution to your SharePoint farm, copy the wsp file to one of your SharePoint servers, and run “stsadm -o addsolution -filename yoursolution.wsp”.

Many SharePoint Features

CodePlex has a project for SharePoint 2007 Features. Within this workplace there are features like:

  • Ajax Config Feature
  • Content Type Hierarchy Feature
  • Debug Config Feature
  • Debugger Feature
  • Features Source Code
  • Log Viewer Feature
  • Manage Configuration Modifications
  • Manage Form Users Feature
  • Manage Hierarchical Object Store Feature
  • Manage Layouts Site Map Feature
  • Minimal Master
  • Minimal Publishing Site
  • Placeholder Master Feature
  • Presence Contact List Feature
  • Print List Feature
  • Task Alert Feature
  • Task Mover Feature
  • Theme Changer Feature
  • Window Links Feature

Especially the Ajax Config Feature is great. In the future I will release more Webparts based on Ajax. This makes it much more easier to deploy them 🙂