Monday, December 17, 2007

Luke, don't use the '-force' (when reinstalling features)

Just a quick post to document a problem that I was having.

I was refreshing my memory on Event receivers and was following this tutorial:

The only difference between my code and the example was that I put in a comment (<!--like this-->) between the <Receivers> opening tag and the <Receiver> opening tag just to document something....well, SP doesn't like this at all and I got this error:

Cannot insert the value NULL into column 'Name',
table 'WSS_Content_Portal.dbo.EventReceivers';
column does not allow nulls. INSERT fails.
The statement has been terminated.

So I took out the comment and reran the install and activate commands (from the command line) and everything worked fine...or so it said (I got the operation completed successfully), message.

However when trying to test the sample (after activating), I created a new announcements list and got an error. I checked the logs and lo and behold, there was my the error again:

'Cannot insert the value NULL into column 'Name',
table 'WSS_Content_Portal.dbo.EventReceivers';
column does not allow nulls. INSERT fails.
The statement has been terminated.'

After plenty of fruitless searching for answers I decided to just deactivate the feature, fully uninstall the feature, then reinstall and activate. After that, everything worked like a charm.

Even though I had the -force option in the installfeature command, it still didn't work, so my advice, to avoid future headaches, is to fully uninstall any features when modifying them.

Wednesday, August 15, 2007

Using Forms Authentication in WSS 3.0

There are a million places that have the instructions on how to do this, but there's one caveat: you need to include the application name in the providers section of your web.config file.

Here's a link to a good tutorial on how to get everything done, just make sure when you get to the part where you're pasting in the membership section you put the IIS Application name (not necessarily the description, go to the properties of the web application and find out what the actual application name is). If you're copying from machine.config the default application name will be '/'. If you don't change it it won't work.

Wednesday, April 4, 2007

My Site as separate web application

During the configuration of the SharePoint site, per Scot Hillier's book you are instructed to set up the Shared Services Provider creating separate Web Applications for the Shared Services (on port 8080) and Personal sites (on port 8081).

Once I did this I continued on until I got to the Shared Services section of the book (chapter 4) and began playing with the My Site feature. The first thing I noticed (after enabling Self Service Site creation) was that each My Site I tried to create (as various different users) would fail. I began digging through the Central Admin and went to the Shared Services administration. On the 'User Profile and My Sites' section, click the 'My Site Settings' link and ensure that in the 'Personal Site Services' section the 'Personal Site Provider' is your Web Application you indicated as your Personal Sites Application (if you followed the book's instructions in setting up Shared Services it should be the app on port 8081). That got the mysites working for me (from the same domain - read on if you are accessing from outside the domain).

In my test environment, I have the client PC that I access my MOSS installation outside of the domain that the SharePoint Server is in. In order to get the My Site feature fully working in this setup I had to provide alternate access mappings in Central Administration for the Personal Sites Web Application (again if you followed Hillier's setup it should be on port 8081) so that external clients are told to go to a URI that they can access.

In the beginning...

Welcome to SharePointers! I set this blog up to track my progress learning everything there is to know about SharePoint 2007. I've been working with SharePoint 2007 since the beta in various experimental configurations.

I've now found a book by Scot Hillier, who wrote a very comprehensive SharePoint 2003 book, that seems to be just what I've been looking for to tie everything together. Because the project I am working on has a few differences from the configuration Hillier uses in his book, I'll be documenting/discussing any hurdles I encounter as I move through, so that others may learn from what I have done. For more info on this book (available in both C# and VB.Net versions) you can check out Hillier's site or you can buy it from Amazon