我正在寻找一种方法,在每个构建过程中只运行一次我定义的目标,而不是为每个构建的项目。
我在 nuget.targets 文件中定义了以下内容
<Message Text="custom clear!!!" Importance="High" />
<ItemGroup>
<_tenant Include="$(PackagesDir)\Tenant.1.1.0\**\*">
</ItemGroup>
<Delete Files="@(_tenant)">
<RemoveDir Directories="$(PackagesDir)\Tenant.1.1.0\>
</Target>```
Should only run once no matter how many projects the msbuild process is building, currently it happens for each project.
It shouldn't matter if I hit (Re-)Build Soltution or (Re-)Build [ProjectName] or hit F5 in Visual Studio, as long any build happens I want to exectue MyTarget only once.