Just got a request from someone that they could only see only certain Custom Web Parts not all (developed in Visual Studio 2008) for selection in SharePoint . They were trying to add the web part to a web zone on a page. They created a new solution and were deploying their web part using VSeWSS 1.3. The ‘Deploy’ option in Visual Studio option did not error out so there was not issue there.
The first thing we checked was did the SharePoint DLL get copied in the appropriate folder in our case C:\Inetpub\wwwroot\wss\VirtualDirectories\<portnumber>\bin. It did. The date time stamps were also reasonably in sync.
Next we checked if the DLL contained web part definitions, we did this by using StartàAll ProgramsàMicrosoft Visual Studio 2008àVisual Studio ToolsàVisual Studio Command Prompt. Type in ILDASM, this will open the .NET Framework Disassembler à Open the SharePoint WebPart DLL from the bin directory mentioned above. The WebPart Definitions were not there!
That meant that deploy was not copying the files to the right location. Next thing was to check the location where the files were being deployed Open the solution in Visual Studio 2008à Project Properties à Debug tab. The start browser was set to http://localhost/ which was not the SharePoint site where the web part was support to be deployed it was supposed to be deployed at http://localhost:<portnumber>. We changed the URL and the web parts were now visible!
So the question was why did the Web Part DLL exist in the wrong directory in the first place, the answer turned out to be there were older versions of the Web Part project which had their URL’s set correctly which were still being compiled by developers currently hence the confusion.
Moral of the story: Check your URL First, then the contents of the DLL to check if the Web Parts are being deployed correctly. Off course you could have a host of other issues that could prevent your web parts from being shown, but this is what happend in this case.