VSPackage: flavored project type not added to "New Project" dialog after VSIX install RRS feed

  • Question

  • (Sorry for the delete-repost-- my user name was based on my email address, so I changed it to avoid spambots, but the name on the post wasn't updated.)

    I am working on a C# flavored project type in VS2010 SP1 (a subtype of the standard C# project). The package contains one project template and one project item, both with .vstemplate files. I have tested both in the Experimental Instance, and it works properly there: both the project and item show up in their respective "Add..." dialog, I can open my flavored projects, and . The problem is, when I attempt to install the VSIX in the normal (non-Experimental) instance, the new project and item types are nowhere to be found.

    Oddly, I know the project has at least partially succeeded in being installed because I can open flavored projects I created in the Experimental Instance, and my customizations there seem to work fine. The only difference I have noted between the Experimental Instance and the main instance is in the 10.0 and 10.0Exp directories buried under AppData. In 10.0Exp, there is a ProjectTemplates subfolder with the .zip for my project type underneath it, and a corresponding folder called ProjectTemplatesCache_{guid} that holds another copy of the .zip and a cache.bin file. Neither folder is present in 10.0.

    I have tried copying ProjectTemplates from 10.0Exp to 10.0 manually, with no effect. I have tried running devenv /installvstemplates, with no effect. I even dug around in the registry to see if anything looked off, but nothing jumped out at me. So now, I'm coming to you. Can anyone provide any insight into this?

    Background: The project output is a class library, and most of the customization provided by the project type is currently limited primarily to deployment and debugging of the library: on deploy, project files are copied to various locations based on configuration in one of the project items, and when the debugger is started, the latest versions of related libraries and a client application are locally staged based on server-side configuration. This allows the library to be tested in something like its destination environment.

    The items are registered with attributes on my Package subtype the following attributes (The D stands for a name that I am redacting):


    [ProvideProjectFactory(typeof(DToolPackageFactory), null, "D Tool Packages (*.csproj);*.csproj", "csproj", "csproj", @".\\NullPath", LanguageVsTemplate = "DToolPackage", NewProjectRequireNewFolderVsTemplate = false)]
    [ProvideProjectItem(typeof(DToolPackageFactory), "D Project Items", @".\\NullPath", 500)]


    OS is x64 Windows 7, if that matters.

    Again, this all seems to work in the experimental instance. Why wouldn't it work in the normal instance? Any help would be greatly appreciated.

    Wednesday, April 20, 2011 5:03 PM


  • Well, after a lot more fruitless tinkering, I reset my Experimental Instance and discovered that my project has suddenly stopped adding itself to the New Project dialog even in the Experimental Instance. I'm totally baffled-- this was working perfectly before, and to my knowledge I haven't changed anything that might matter. So, here's what I know:

    1. The project builds fine, with no errors. The VSIX is created and the project template ZIP file is output to the bin\Debug\ProjectTemplates folder.
    2. The project template ZIP file is also copied to AppData\Local\Microsoft\VisualStudio\10.0Exp\ProjectTemplates.
    3. However, when running the Experimental Instance and clicking New Project, the project type does not show up. Also, no ProjectTemplatesCache folder is created in 10.0Exp, like it used to be.
    4. The package does show up in About, and I can load custom project types I have previously created with no problem. My deployment customizations also work, so I know the package is running properly aside from integration with the New Project and New Item dialogs.
    5. No amount of running devenv /setup on the Exp root seems to make any difference.

    So, does anyone have any idea what might cause this? I'm not really sure when it stopped working-- I was tinkering with the deployment/debugging features of my project and tweaked the contents of the project template (basic stuff-- just removed/added a few files). I didn't do anything that I would expect to affect the package registration or related processes.

    If it matters, I can post more information, but I don't even know where to look. The .vstemplate, maybe? or the registration attributes? Any help would be greatly appreciated.

    EDIT: Solved. Taking a cue from this page, I looked in my .vsixmanifest and saw that there was nothing in the Content section. When I added my project template as content, reset the Experimental Instance, rebuilt, and tried debugging again, this succeeded in adding the project type to the New Project dialog. I guess that must have been included before and then somehow removed, but I'm not aware of having done it. Thanks for looking!

    • Edited by Dominic Pease Thursday, April 21, 2011 5:15 PM Problem solved
    • Marked as answer by Dominic Pease Thursday, April 21, 2011 5:15 PM
    Thursday, April 21, 2011 4:20 PM