I have sandbox solution which has 2 features (both are sitecollection level features) I am activating both feature using same USER.
feature 1 : that upl
If you use the Record Center as the template for your root website in SharePoint 2010, GetCustomListTemplates() will always return 0 (zero).
There is some weird bug that makes this happen.
Here is code that you can try running in the SharePoint PowerShell. The return value for GetCustomListTemplates($web).Count will be zero if you have the root web made from the Record Center template.
$site = get-spsite("http://localhost")
$web = $site.RootWeb
$list = $web.Lists["TestDocLibrary"]
$list.SaveAsTemplate("MyListTemplate.stp", "MyListTemplate", "My List Template", $false)
$site.GetCustomListTemplates($web).Count
More information can be found at the following web pages:
Good luck! - Jason
Does your list template derive from one of the default list templates like "Discussion Board"? I noticed that when I tried to do the following I encountered the same problem as you:
I noticed that the default "Discussion Board" list template was not even an option for creating a new list in SharePoint 2010. Therefore I went to the site features and and turned on the "Team Collaboration Lists" just to enable the default "Discussion Board" list template. After doing that both the default "Discussion Board" list template and my custom "Bulletin Board" template showed up when I went to create a new list. Then I went to my powershell script and noticed that GetCustomListTemplates returned my custom template. I'm assuming that means the C# should work as well.
Here is the list from the old SharePoint 2007 website:
Here is the collaboration feature that enables the "Discussion Board" list template in the new SharePoint 2010 website:
Here is the menu for creating a new list in the new SharePoint 2010 website AFTER enabling the team collaboration lists feature:
As you can see the "BulletinBoard" image is the same as the "Discussion Board" image so SharePoint probably couldn't use the "BulletinBoard" template because the "Discussion Board" template was not yet installed.