我的 asp.net core 6 项目正在引用一个 blazor nuget 库,该库在运行时复制一些文件以发布输出目录dotnet publish
我想阻止某些文件被发布。
ResolvedFileToPublish
但是从yarget 之后删除这些文件ComputeFilesToPublish
不起作用。
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.Blazor.Calendars" Version="19.3.0.56" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="19.3.0.56" GeneratePathProperty="true" />
</ItemGroup>
<Target Name="RemoveFilesFromPublish" AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<!-- ResolvedFileToPublish does not contain staticwebassest
<BlazorThemes Include="$(PkgSyncfusion_Blazor_Themes)\staticwebassets\*.*" />
<DotNetPublishFiles Remove="@(BlazorThemes)" />
<ResolvedFileToPublish Remove="@(BlazorThemes)"></ResolvedFileToPublish>
<ResolvedFileToPublish Remove="$(PkgSyncfusion_Blazor_Themes)\staticwebassets\*.*"></ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>