Skip to content

Instantly share code, notes, and snippets.

@SelvinPL
Created March 10, 2026 23:42
Show Gist options
  • Select an option

  • Save SelvinPL/22c5945796b10d39e377d0a0f1930bf6 to your computer and use it in GitHub Desktop.

Select an option

Save SelvinPL/22c5945796b10d39e377d0a0f1930bf6 to your computer and use it in GitHub Desktop.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageID>MyBuildTool</PackageID>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NoWarn>$(NoWarn);NU1702;MSB3270;NU5128</NoWarn>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="...\MyBuildTool\MyBuildTool.csproj" PrivateAssets="all" />
</ItemGroup>
<Target Name="BuildOtherAssemblies" AfterTargets="ResolveAssemblyReferences" DependsOnTargets="ResolveAssemblyReferences">
<ItemGroup>
<OtherAssemblies Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'all'))" />
<MyBuildToolOutputFiles Include="%(OtherAssemblies.RelativeDir)\*.*" />
</ItemGroup>
<ItemGroup>
<Content Include="@(MyBuildToolOutputFiles)" CopyToOutputDirectory="PreserveNewest">
<Link>%(FileName)%(Extension)</Link>
<Pack>true</Pack>
<PackageCopyToOutput>true</PackageCopyToOutput>
<PackagePath>contentFiles\any\any\MyBuildTool</PackagePath>
</Content>
</ItemGroup>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment