-
|
Hey @teneko . I have another question I'd like to ask you. Our team has a unified CI process for building all dotnet projects within the company. Instead of having every project in each team install this nuget package, I want to integrate it into the CI process so that it takes effect automatically for all projects. Are there any good methods? I know that MSbuild supports globally customized Tasks or Targets, but in your project, the two Targets under build/xxx and buildMultiTargeting/xxx confuse me, and I don't know how to use them. Additionally, I am in China. All these contents were translated by AI. If there are any inaccuracies, please forgive me. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @ymstar, Your question is clear, and the AI translation is good enough, so no problem. Short answer: yes, you can apply this package centrally in CI, but not completely automatically unless you provide some shared MSBuild import. This package works through the standard NuGet The cleanest approach is to put the For example, a shared <Project>
<ItemGroup>
<PackageReference Include="Tenekon.MSBuild.Packaging.ProjectBuildInPackage" Version="2.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>And a project that wants to embed the output of another project would still do this: <ItemGroup>
<ProjectReference Include="..\MyLibrary\MyLibrary.csproj"
PrivateAssets="all" />
</ItemGroup>That part is important because this package intentionally looks for There is also an optional mechanism if you want more explicit control from central MSBuild logic. NuGet supports If you use that approach to import the package's For example: <Project>
<ItemGroup>
<PackageReference Include="Tenekon.MSBuild.Packaging.ProjectBuildInPackage" Version="2.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; native; contentfiles; analyzers</IncludeAssets>
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
</ItemGroup>
<Import Project="$(PkgTenekon_MSBuild_Packaging_ProjectBuildInPackage)\build\Tenekon.MSBuild.Packaging.ProjectBuildInPackage.props"
Condition="Exists('$(PkgTenekon_MSBuild_Packaging_ProjectBuildInPackage)\build\Tenekon.MSBuild.Packaging.ProjectBuildInPackage.props')" />
</Project>In practice, this is optional, because a normal If you want to do this only in CI, you can generate or import a shared So the practical answer is:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Hi @ymstar,
Your question is clear, and the AI translation is good enough, so no problem.
Short answer: yes, you can apply this package centrally in CI, but not completely automatically unless you provide some shared MSBuild import.
This package works through the standard NuGet
build/andbuildMultiTargeting/folders. In normal usage, you do not call those files manually. NuGet imports them automatically when a project references this package and restores it. ThebuildMultiTargeting/folder is mainly relevant for the outer build of SDK-style projects that useTargetFrameworks. In this package, it just forwards to the same logic frombuild/, so in practice you usually do not need to treat …