0

我想让你问一下 IntermediateAssembly 最初设置在哪里。

我问我想优化我的作业以仅在初始化 IntermediateAssembly后应用的原因。

考虑以下比较:

<Project Sdk="Microsoft.NET.Sdk">
    <ItemGroup>
        <!-- NOT WORKING: list is empty -->
        <ModuleInitializerAssemblyLoaderInjectionTargetAssemblies Include="@(IntermediateAssembly->'%(Identity)')" />
    </ItemGroup>
</Project>
<Project InitialTargets="init" Sdk="Microsoft.NET.Sdk">
  <Target Name="init">
    <ItemGroup>
        <!-- WORKING: list is initialized -->
        <ModuleInitializerAssemblyLoaderInjectionTargetAssemblies Include="@(IntermediateAssembly->'%(Identity)')" />
    </ItemGroup>
  </Target>
</Project>

dotnet sdk中,我找不到最初设置 IntermediateAssembly 的参考。

4

1 回答 1

2

经过搜索,我在这里找到了它https://github.com/dotnet/msbuild/blob/fdddb27ebec8f6a51513b6e869f039a32d3a8c39/src/Tasks/Microsoft.Common.CurrentVersion.targets#L359

它设置在Microsoft.Common.CurrentVersion.targets一个节点ItemGroup下。Project

于 2020-08-01T23:33:38.590 回答