Obfuscation.Tasks
1.0.1
See the version list below for details.
dotnet add package Obfuscation.Tasks --version 1.0.1
NuGet\Install-Package Obfuscation.Tasks -Version 1.0.1
<PackageReference Include="Obfuscation.Tasks" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Obfuscation.Tasks --version 1.0.1
#r "nuget: Obfuscation.Tasks, 1.0.1"
// Install Obfuscation.Tasks as a Cake Addin #addin nuget:?package=Obfuscation.Tasks&version=1.0.1 // Install Obfuscation.Tasks as a Cake Tool #tool nuget:?package=Obfuscation.Tasks&version=1.0.1
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.0
or PowerShell:
Install-Package Obfuscation.Tasks -Version 1.0.0
or Edit project items:
<ItemGroup>
<PackageReference Include="Obfuscation.Tasks" Version="1.0.0">
<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" InputFilePath="$(TargetPath)" DependencyFiles="" OutputFilePath="" TimeoutMillisecond="2000" Importance="high">
<Output TaskParameter="ObfuscationedFilePath" PropertyName="SecuredFilePath" />
</ObfuscationTask>
<Message Text="SecuredFilePath: $(SecuredFilePath)" 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" InputFilePath="$(TargetPath)" Importance="low">
<Output TaskParameter="ObfuscationedFilePath" PropertyName="SecuredFilePath" />
</ObfuscationTask>
<Message Text="SecuredFilePath: $(SecuredFilePath)" Importance="high" />
</Target>
Input Parameters:
ToolDir
: Required. Example:\\192.168.1.155\dll
InputFilePath
: Required. Example:D:\sources\ObfuscationSamples\ObfuscationSamples\bin\Release\ObfuscationSamples.dll
DependencyFiles
: Optional. Example:$(OutputPath)Serilog.dll;$(OutputPath)Serilog.Sinks.Console.dll
OutputFilePath
: Optional. Default value:$(InputFilePath)_Secure.dll
. Example:D:\sources\ObfuscationSamples\ObfuscationSamples\bin\Release\ObfuscationSamples_Secure.dll
TimeoutMillisecond
: Optional. Default value:30000
Importance
: Optional. Default value: Normal. Options:High
,Normal
,Low
. ReferenceMessage
task.
Output Parameters:
ObfuscationedFilePath
: string. Default value:OutputFilePath
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.