add a `dotnet new template` for create a new ready to pack template
See original GitHub issueAdd a dotnet new template
So is ready to use with just dotnet restore
and dotnet pack /p:Version=1.2.3
More options:
dotnet new template --type project
(or--type item
)dotnet new template --sample option
to add a sample conditional option
Is possibile to create package the template in lot of ways (nuget, nuspec, csproj, prj)
The best one i know atm is doing just with a .proj
(any extension is ok), like https://github.com/fable-compiler/Fable/blob/master/src/templates/simple/Fable.Template.proj
so like Fable.Template.proj
(note the .proj
extension, neutral, not csproj, so doesnt mess with compiler targets)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- fill some nuget package props (optional) -->
<Description>Simple Fable App</Description>
<Authors>Alfonso Garcia-Caro</Authors>
<!-- fill nuget package version (optional) -->
<Version>0.2.1</Version>
<!-- this is a package -->
<PackageType>Template</PackageType>
<!-- cruft need to avoid building and making dotnet sdk happy -->
<PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetFramework>netstandard1.0</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
<!-- simple way to exclude things (optional but nice) -->
<ExcludeFromPackage>
Content/node_modules/**/*;
Content/packages/**/*;
Content/public/bundle.js*;
Content/bin/**/*;
Content/obj/**/*;
</ExcludeFromPackage>
</PropertyGroup>
<ItemGroup>
<Content Include="Content/**/*" Exclude="$(ExcludeFromPackage)" >
<PackagePath>Content\</PackagePath>
</Content>
</ItemGroup>
</Project>
ref https://github.com/dotnet/dotnet-template-samples/issues/14
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Create a template package for dotnet new - .NET
Learn how to create a csproj file that will build a template package for the dotnet new command.
Read more >Create dotnet new template with multiple projects
Go to your root folder, open the powershell console. Create a nuget package dotnet pack .\nuget.csproj. Install the nuget package dotnet new -i ......
Read more >Making a custom 'dotnet new' template - PatridgeDev
This is the first in a series of posts about creating custom templates for the dotnet new system. How to template. There are...
Read more >How to Create Your .NET Project Template
This template allows developers to have a ready-to-run Auth0-enabled starter ... Then, add a new file named template.json to this newly created folder...
Read more >How to build a .NET template and use it within Visual Studio ...
Like any NuGet package, you can upload the template pack to a NuGet feed. The dotnet new -i command supports installing the template...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like this has been merged https://github.com/tintoy/dotnet-template-templates/releases/tag/v0.1-beta1, thanks @tintoy!
Cheers! Will get both sorted first thing tomorrow 😃