As a side project, I am creating a new Project Type for Visual Studio using Managed Package Framework from VS 2005 SDK.
I have read an excellent post on the matter, so mostly it was a piece of cake.
But I had one problem: Build was not available as a menu item and Build Selection was greyed out when I selected my custom project.

Adding Target Name=”Build” to the project template and specifying it in DefaultTargets did not help.

After some experiments I have found out a minimal *proj file that has Build menu item available (if you have already inherited the MPF ProjectNode).
It is quite interesting:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' " />
</Project>

It seems that the Configuration comparison gets parsed into the Configuration values for this project.
I am not sure whether Visual Studio or MPF does this.

Of course, if you actually want this menu item to work, you will have to add a default target, but that’s quite easy.

  • http://mikehadlow.blogspot.com Mike Hadlow

    Thanks Andrey, it’s always nice to be linked. Mike (code rant)

  • Norbert

    Your post saved me a lot of time Andrey. Thank you!

  • chetan53

    hey. i have added new custom project type and register it too using regpkg.exe but it is not visible in Visual Studio File->New Project menu.? help me out

  • Norbert

    Hi. It needs some tasks to be performed to make your project visible in the new project dialog.

    1. You need a Project Template based on your project file and it has to be copied into the proper Visual Studio directory. This directory can be determined by the following registry key: HKLMSoftwareMicrosoftVisualStudio9.0VSTemplateProject -> UserFolder.

    The basic Managed Project Framework examples about how to build a custom project type give detailed explanation of the way how can you construct your own distributable project template. Follow them.

    2. You need some registry entries to tell the Visual Studio where your project template should be found. These are the followings:
    HKLMSoftwareMicrosoftVisualStudi9.0NewProjectTemplates..
    HKLMSoftwareMicrosoftVisualStudi9.0Projects..

    Analyse the existing registry content of other project types beneath these registry locations to explain its structure, and place your own project entries.

  • http://larsmediagroup.com/beat-your-competiton-now.html Beat Your Competiton Now | Online Marketing For Business 860-661-0493

    [...] Less Than 2 MinutesHow to Target Keywords not in Your UrlHow To Choose The Right Keywords To TargetMaking a Visual Studio Custom Project Type buildable // IE Evitar seleccion de texto document.onselectstart=function(){ if (event.srcElement.type [...]