Obfuscation.Tasks
1.0.2
dotnet add package Obfuscation.Tasks --version 1.0.2
NuGet\Install-Package Obfuscation.Tasks -Version 1.0.2
<PackageReference Include="Obfuscation.Tasks" Version="1.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Obfuscation.Tasks --version 1.0.2
#r "nuget: Obfuscation.Tasks, 1.0.2"
// Install Obfuscation.Tasks as a Cake Addin #addin nuget:?package=Obfuscation.Tasks&version=1.0.2 // Install Obfuscation.Tasks as a Cake Tool #tool nuget:?package=Obfuscation.Tasks&version=1.0.2
Obfuscation.Tasks
Summary
This is an MSBuild custom task that can be triggered at any event after compilation to automatically obfuscate assembly files.
Usage
Install package
.NET CLI:
dotnet add package Obfuscation.Tasks --version 1.0.2
or PowerShell:
Install-Package Obfuscation.Tasks -Version 1.0.2
or Edit project items:
<ItemGroup>
<PackageReference Include="Obfuscation.Tasks" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
Configure ObfuscationTask
Triggered after PostBuildEvent
:
<Target Name="Obfuscation" AfterTargets="PostBuildEvent">
<ObfuscationTask ToolDir="\\192.168.1.155\dll" InputFilePaths="$(TargetPath)" DependencyFiles="" OutputFileNameSuffix="" TimeoutMillisecond="2000" Importance="high">
<Output TaskParameter="OutputFilePaths" PropertyName="SecuredFilePaths" />
</ObfuscationTask>
<Message Text="SecuredFilePaths: $(SecuredFilePaths)" Importance="high" />
</Target>
Or trigger after publication.
Here's a detail, when the OutputType
is Library
, it needs to depend on the GenerateNuspec
target.
When the OutputType
is Exe
, it needs to depend on the Publish
target.
<Target Name="Obfuscation" AfterTargets="GenerateNuspec">
<ObfuscationTask ToolDir="\\192.168.1.155\dll" InputFilePaths="$(TargetPath)" Importance="low">
<Output TaskParameter="OutputFilePaths" PropertyName="SecuredFilePaths" />
</ObfuscationTask>
<Message Text="SecuredFilePaths: $(SecuredFilePaths)" Importance="high" />
</Target>
Input Parameters:
ToolDir
: Required. Example:\\192.168.1.155\dll
InputFilePaths
: Required. Single example:D:\sources\ObfuscationSamples\ObfuscationSamples\bin\Release\ObfuscationSamples.dll
; Multiple examples:$(TargetPath);D:\ref\Samples1.dll;D:\ref\Samples2.dll
DependencyFiles
: Optional. Example:$(OutputPath)Serilog.dll;$(OutputPath)Serilog.Sinks.Console.dll
TimeoutMillisecond
: Optional. Default value:30000
Importance
: Optional. Default value: Normal. Options:High
,Normal
,Low
. ReferenceMessage
taskOutputFileNameSuffix
: Optional. Default value:_Secure
Output Parameters:
OutputFilePaths
: string. Default value:$(InputFilePaths)$(OutputFileNameSuffix).dll
. Example:D:\sources\ObfuscationSamples\ObfuscationSamples\bin\Release\ObfuscationSamples_Secure.dll
Support
Support MSBuild v15.0 or higher.
Samples
Authors
License
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.