I want to create project template from folder containing few html/js files. More files can be added on later.
For this, I followed the Getting started with vsix project template .
Simply, there are 2 main steps:
source.extension.vsixmanifest
and in Assets add type - project template type and source - above zip file location Now, since I have Non .Net based files, I need to have solution folder and export it. But when I create solution folder option for exporting is disabled in project menu. Is there any way to export solution folder?
I also tried with empty console project. In this case after installing from vsix (output from project in step 2), the new project is created with empty folder - no html/js files included. Also, the new template is shown under C# project, it would be better if shown under other project type. My csproj file for reference below:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>Net47</TargetFramework>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Folder Include="MyJSFolder\" />
</ItemGroup>
</Project>
So, how do create project template in this case?
Current version of Visual Studio only could export Project template and Item template, both of them don't include solution folder.
If you want to add solution folder in project template, I suggest you add a custom wizard extension for your project template. And then in RunFinished method to add files to your solution. Because at time of RunStarted method executing, project structure has been created in Temp folder and DTE is trying to read files from Temp folder which are not existing.
Following document introduce how to create custom wizard extension and project template.
https://www.codeproject.com/Articles/391989/Working-with-Project-Template-and-Wizard-Extension
In the RunFinished method to add files with the code in this thread.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.