When you download and install  the Visual Studio 2005 Extensions for WSS3.0.
You could have taught wow my deployment stress is over
But actually it isn't  its just the start

I had deployed several webparts to my sharepoint sites without getting the error 

Object reference not set to an instance

But after sometime these ugly errors started popping up .

One was
Object reference not set to an instance the other was some GUID error


After pulling out my hair i didn't have i found an individual who shed a light on it here at   WSSWIKI

He even add a missing feature application you can download.But when i tried running the application
i get error it can't access the database

Later i found this solution below :-

PROBLEM:

========

Deploying webpart to SharePoint 2007 using  Visual Studio Extensions for Windows SharePoint Services (VSE WSS) and getting error message “Object reference not set to an instance of an object”.

 

RESOLUTION:

===========

1] Copy the built webpart.dll to c:\windows\assembly (GAC)

 

2]  In the folder location where webpart VSE solution was created found setup.bat file in bin\Debug, and this is the file which VSE calls when deploying the solution and has instructions to run it. Ran the setup.bat from command prompt as “setup /uninstall” this ran ok, then ran setup /install this ran ok too. Modified the setup.bat file and add the line to remove the webpart.dll from the GAC and add the webpart.dll assembly to GAC as under:

 

under :LDeploy section before goto :EOF added the following line:

===========================================================

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -if webpartTest.dll

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -uf webpartTest

iisreset

**Make sure you changed the name of your webpart to the one in question

This solved my problem but sometimes it did work sometimes it didn't and  the solution need a lost of manual process.

Al last i came across this featurecleaner Utility
And it did the TRICK it actually fixes it and deletes orphaned features from the feature table.

Hope the next VseWSS ver 1.2 will be out soon

Enjoy