I have a C# asp.net Core WPF application. I have a obfuscator that I have included in my main projects publish.
It works by building, then obsfactating and then copying the dll files over the published files.
This how that works:
<Target Name="Obfuscation" AfterTargets="Build" Condition=" '$(Configuration)' == 'Release'">
<Exec WorkingDirectory="$(TargetDir)" Command="obfuscar.console $(ProjectDir)obfuscar.xml" />
<ItemGroup>
<DistFiles Include="$(OutDir)Obfuscated\**\*.dll; $(OutDir)Obfuscated\**\*.exe" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.RecursiveDir)%(DistFiles.Filename)%(DistFiles.Extension)</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
<Target Name="CopyObfuscation" AfterTargets="Obfuscation" Condition=" '$(Configuration)' == 'Release'">
<Exec Command="DEL $(TargetDir)\_obs\Mapping.txt" />
<Exec Command="MOVE $(TargetDir)\_obs\*.* $(TargetDir)" />
</Target>
This works fine.
However I have a visual studio installer project (https://learn.microsoft.com/en-us/visualstudio/deployment/installer-projects-net-core?view=vs-2022)
This is set to package the files from the publish.
there are not a lot of options.
When I build the installer package, it uses the publish profile (Properties\PublishProfiles\FolderProfile.pubxml)
but it does not run the obsfcacation script (that is in the main project .csproj file)
How can I package the obsfacated files instead?
