I have 3 .net standard SDK projects(Utils, Reporting and Testing) that I want to pack them into one nuget package called Shared and upload it in my local package management system to be able to be used in my other projects. I was thinking to use the csproj file(s) to fill all the package information so I don't have to use nuspec file(s). One way I tried is to create a new .net standard project called Shared that references all the first 3 projects and only fill the Shared.csproj.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Copyright>Copyright (c) Me</Copyright>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<SkipCopyBuildProduct>true</SkipCopyBuildProduct>
<GenerateDependencyFile>False</GenerateDependencyFile>
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Utils.csproj" />
<ProjectReference Include="..\Reporting.csproj" />
<ProjectReference Include="..\Testing.csproj" />
</ItemGroup>
</Project>
I've tried this msbuild command:
dotnet msbuild -t:pack=Shared.csproj;-p:Configuration=Release;PackageOutputPath=.\release;
and this nuget cli command:
nuget pack Shared.csproj -Build -IncludeReferencedProjects -Prop Configuration=Release
but they don't work. I'm not sure which one is more suited.
Are there more suited alternatives?
Later edit: I've added my code to github with @mu88's suggestion to not create a project only for grouping my other projects but I don't get the 3 projects in my nupkg's libs folder. Do I also specify each project in the dependencies.group section?