I am trying to obfuscate bunch of files in a directory and every build there are more and more files being generated. I would like to know if there is a way I can dynamically create the Dotfuscator configuration xml file using a MSBUILD task that will generate the xml file every time there is a new file added to the directory?
MSBUILD Dynamically Create Config XML Dotfuscator
1.3k Views Asked by varun7447 At
2
There are 2 best solutions below
0
varun7447
On
The latest Dotfuscator version 4.41.1 has the latest flag true This will generate the Dotfuscator config file if the file is missing. Also you can add this to the csproj as documented in the latest getting started guide https://www.preemptive.com/dotfuscator/pro/userguide/en/getting_started_protect.html
Related Questions in MSBUILD
- Is it possible to build v142 project with v143 build tools?
- Source generators get the referencing project path - retrieve useful value from IncrementalValueProvider<string>
- Is there a way to read .csproj PropertyGroup variable in c#
- MSBuild trying to copy different dll with similar name into project sporadically
- SDK exe project creates net472 folder when build
- Because my api, after publishing through the AzureDevops pipeline in flurl methods, the entryPointNotFoundException exception is occurring
- Parameterised item in MSBuild project
- Microsoft.Build.Evaluation.Project (Version 17.9.5) causes Exception
- ##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'
- Clean Syntax to Force Property to Have Value
- AzureDevops build pipeline gets cancelled due to time out during donet build command
- How to dynamically Change appsettings.json Based on Build Configuration in .NET
- Runtimes Directories Are Being Generated Only in Debug Mode With MSBuild
- How to specify directory where the RootNamespace should be?
- How to use BuildManager with C#8.0?
Related Questions in OBFUSCATION
- Persistent Browser Extension Reinstalls Itself: How to Eradicate ‘YOfficeStop’ Permanently on Windows 7?
- Instagram-like CSS class names obfuscation for NextJS 14 with SWC
- How to get deobfuscation file in React Native app with obfuscator-io-metro-plugin
- cannot import name '__pyarmor__' from 'hexlet_python_package.libruntime' (unknown location)
- yGuard obfuscated jar will not connect to database with Hibernate
- Getting error while obfuscating with Dasho jar java 17
- Import error in obfuscated code by my script
- I want to disable Lua obfuscation
- How can i deobfuscate base64 zlib when i have obfuscate method?
- How to Obfuscate Codes in Nuxt 3?
- Does Flutter support obfuscation of appbundle?
- Need help identifying what type of obfuscation is this
- Is .NET Reactor of any use, against dotPeek?
- ProGuard doesn't like anonymous classes inside other anonymous classes after latest Eclipse update
- protect credential in strings.xml inside apk file
Related Questions in MSBUILD-TASK
- Create custom file into the repository during dotnet build
- How to block (ban, forbid) specific dependency in MSBuild SDK style project (C#)?
- Invoke the Powershell Script during local testing with MSBuild
- Programmatically triggering MSBuild is giving build error for Edit & Continue /ZI property
- File Locking Issue When Using Custom MSBuild Task in Development Mode
- Move a Xamarin Android native app from VS2022 to VSCode
- Using Directory.Build.props to copy files from different projects to output dir
- VS 2019 Community - How to install MSBuild MT Task?
- Using MSBuild to deploy an ASP.NET website project
- Replacing PixelShaderCompile task with fxc.exe (necessitated by moving to VS2022). Getting same functionality. Putting in resource (embedded?)
- Error when using MSBuild.exe to publish a .NET 6.0 C# project for Windows and Linux x64 with /p:NoBuild=true
- Possibilty of removing MVCBuildViews target from a C# ASP .Net project
- Hide embedded nuget files from VS solution explorer
- How to override the way CLCompile processes the source files in MSBuild?
- How to make sure the application is built with the latest class library
Related Questions in MSBUILDCOMMUNITYTASKS
- Is there a way to prevent visual studio to remove a file or write ItemGroup with remove action?
- MSBUILD RegexReplace get all text till 2nd last dot from end
- Warning MSB3245: Could not resolve this reference for log4net
- Access Nuget Packages hosted in private Nuget Server in Azure Pipelines
- how to add stop msbuild from building the project visual studio build option
- The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild
- how to execute a batch file on a remote machine using MSBuild?
- MSBuild: How to access a property value set by a Target during the Post Build event in Visual Studio
- how to get latest this version of MSBuild
- MSBuildCommunityTasks folder missing
- Changes required in Visual studio solution project for MSBuild
- Cake Build Suppress MSBuild Warnings
- MSBuildCommunityTasks FileUpdate $, (, and ) in ReplacementText
- Unable to get correct MSBuildCommunityTasksPath when using MSBUILDTASKS from NuGet in a before.Solution.sln.targets script run on TFS build server
- The "MSBuild.Community.Tasks.FileUpdate" task could not be loaded
Related Questions in DOTFUSCATOR
- Dotfuscator throws 'Object reference not set to an instance of an object.'
- Is Dotfuscator compatible with Visual Studio 2022?
- Dotfucator Community giving "Build Error" Issue for Xamarin Forms android
- Prevent dotfuscator from reusing field names from parent class
- How to obfuscate const variable values using dotfuscator
- dotfuscator getting error Non-public instance method in interface
- Dotfuscator - This is not a managed module
- Consume specific SDK dlls in Nuget package
- Blank screen on Xamarin Forms app using Dotfuscator
- Dotfuscator renaming File version and product version as blank
- Visual Studio 2019 Xamarin Dotfuscator CE Config File Creation Problem
- Xamarin forms app for Android crashes with Dotfuscator community edition enabled
- How to obfuscate public members of Xamarin.Android app with Dotfuscator?
- Root check identifies some android non devices as rooted - Dotfuscator
- Ofuscated code is not working when moved to server
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This might be a good time to use the Directory input. Rather than representing a single assembly (
.exeor.dll), this type of Dotfuscator input captures all the assemblies in a directory. When the contents of the directory change, Dotfuscator's build will automatically pick up any new assemblies.To make a Dotfuscator config file with a Directory input, open the GUI and add an input as you normally would (directions for Community Edition's GUI and for Professional Edition's standalone GUI), but instead of selecting a file from the Browse... dialog, just navigate to the directory and click "Open" while the "File name" is still listed as "Folder Select". Then, save your configuration.
From now on, whenever you run Dotfuscator (whether from the standalone GUI, the command line, the Visual Studio integration, or the MSBuild task), all assemblies in the directory will be processed as input.
Note: If you look at the config file itself, you might be surprised that it will still list individual assemblies:
Despite this layout, Dotfuscator will process all assemblies in the
C:\code\BasicTestApp\BasicTestApp\bin\Debugdirectory when it runs a build based off this config file, not just those two listed. The assembly elements in the config are just there so that you can still make rules against individual assemblies in the GUI (e.g., to make one assembly be in Library Mode). The list represents the state of the directory when the GUI last modified the config.Disclaimer: I work for the Dotfuscator team, and am answering this question as part of my job.
Additional note due to clarification in the comments: the directory package has a feature where you can exclude certain assemblies from obfuscation. These assemblies will be treated as a Package Artifact and just copied from input-to-output without modification. Any obfuscated assemblies that refer to these excluded assemblies will still be processed correctly.
To do this in the GUI, right-click on the assembly within the package, and select "Exclude assembly from package". Or, if you'd prefer to edit the config file, add the following
<option>tag as a child of each relevant<inputassembly>tag: