Tuesday, October 30, 2007

A solution for the VSeWSS "Object reference not set to an instance of an object" problem

For anyone still struggling with the above error in VSeWSS, Paul Liebrand left a comment on my earlier post that really helped me out. 

The issue apparently stems from a mismatch between the features in the content database and the features in the filesystem, so Paul posted an app that identifies the dangling pointers.  For full details, check out the WSSWiki.

http://wsswiki.com/Visual_Studio_Extensions_For_WSS_3.0

The solution worked great for me.  I ran the app, set up the connection string to point to my local content database (the connection string that worked for me is pretty vanilla: Data Source=localhost;Initial Catalog=WSS_Content;Integrated Security=SSPI;), and it spat out the GUIDs for the features that were causing me trouble.  Once I had the list, all I had to do was open up SQL Server Management Studio and delete the offending rows from the dbo.Features table.

UPDATE (10/30/07 3:38 PM):

I did a bit more research today, and it appears that one cause of features getting out of synch is retracting and removing features without deactivating them first.  I always suspected that my features weren't getting cleaned up correctly when I removed their solutions, and I've confirmed today that there is an issue there.  Now, this isn't a huge deal, and VSeWSS doesn't use solutions, so you won't run into this problem if you are using VSeWSS exclusively, but if you have requirements beyond what VSeWSS can do, and are packaging your own solutions, watch out. 

Technorati Tags: , , , ,

0 comments: