ClickOnce
Dotfuscator can protect ClickOnce applications.
Note: Dotfuscator Professional supports the use of ClickOnce
.application
files as inputs. This will automatically protect and repackage the ClickOnce application's assemblies.
To integrate Dotfuscator Community with a ClickOnce project:
In the Visual Studio IDE, disable the
.deploy
extension from being used with your published ClickOnce assemblies:Open the Properties for your ClickOnce project.
Open the Publish tab.
Click Options....
Select Deployment.
Uncheck Use ".deploy" file extension.
Click OK.
Publish the ClickOnce application to a directory on disk, such as
publish\
.Use the Dotfuscator Community User Interface to create and build a Dotfuscator configuration:
Add input assemblies corresponding to your published ClickOnce package. Normally, these are the assemblies located in the
bin\Release
subdirectory of your ClickOnce project, with extensions.exe
and.dll
. Do not include anyvshost
versions of those files.Build the Dotfuscator configuration. The protected assemblies are placed in a subdirectory named
Dotfuscated
by default.
If your assemblies were strong-named, re-sign the protected versions of those assemblies with sn.exe (Strong Name Tool), for example:
sn.exe -R Dotfuscated\YourApplication.exe strong_name_key.snk
Copy the protected assemblies on top of the unprotected versions in the ClickOnce publish location, for example:
copy /y Dotfuscated\YourApplication.exe "publish\Application Files\YourApplication_1_0_0_0\"
Update the application manifest with mage.exe (Manifest Generation and Editing Tool), for example:
mage.exe -Update "publish\Application Files\YourApplication_1_0_0_0\YourApplication.exe.manifest" -CertFile YourKey.pfx -Password your_pfx_password
Update the deployment manifest, for example:
mage.exe -Update publish\YourApplication.application -AppManifest "publish\Application Files\YourApplication_1_0_0_0\YourApplication.exe.manifest" -CertFile YourKey.pfx -Password your_pfx_password
Manually publish (copy) the files to your deployment source location (Web server, UNC share, or CD-ROM).