Search code examples
c#visual-studio-2015vsixvspackagevs-extensibility

CustomProjectSystem folder not created when deploying VSIX Project Type


Description

Using CPS (see link 1 and link 2), I have created a new project type (let say *.myproj) for Visual Studio: File > New Project > Visual C# > Extensibility > Project Type

When debugging, everything is fine. However, when I deploy (install) the vsix package to another PC, and try to create a new project ('.myproj') using the custom project template (myproj), I get the following error:

Runtime error in Visual Studio when trying to create a new project using the custom project template.

The reason is in the ProjectType.myproj in the ProjectTemplate we have this code:

<PropertyGroup Label="Globals">
    <CustomProjectExtensionsPath>
        $(LocalAppData)\CustomProjectSystems\ProjectType4\
    </CustomProjectExtensionsPath>
</PropertyGroup>

<Import Project="$(CustomProjectExtensionsPath)CustomProject.Default.props" />

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" Label="Configuration">
</PropertyGroup>

I figured, after building and running the project Visual Studio, this folder and it's files will be created:

  • (LocalAppData)\CustomProjectSystems\ProjectType4\
  • CustomPrject.Default.props
  • CustomProject.props

Problem

However, when I install my vspackage on another PC for the first time, this folder and it's files are not automatically created, hence, the runtime error in the screenshot.

Workaround

  • I manually copy this files to the other PC then it works fine.
  • I remove those lines of code mentioned above, (this will cause to not to be able to use my own icon for the project node. since VS won't release the project type.)

Question

  • Why these files are not automatically copied to the clients machine?
  • Is there any specific settings or configurations that I am missing?

Solution

  • Found out this is an issue: Project types should not require MSI to deploy build authoring