I'm trying to create a simple dotnet new
template containing a 'default' .editorconfig and .gitconfig, which my team uses.
Unfortunately the .files will not be inclueded during dotnet pack
.
Here's part of my .csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageType>Template</PackageType>
<TargetFramework>net6.0</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
</PropertyGroup>
<PropertyGroup>
<Description>dotnet new templates</Description>
<PackageTags>template dotnet console</PackageTags>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="**\*" />
<Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**;templates\**\.vs\**" />
<Content Include="templates\SolutionTemplate\.editorconfig;templates\SolutionTemplate\.gitignore" Pack="true" />
</ItemGroup>
</Project>
Despite being explicitly added, the .editorconfig and .gitignore will be ignored. Has anyone experience with this?