mkaring / ConfuserEx

An open-source, free protector for .NET applications
https://mkaring.github.io/ConfuserEx/
MIT License
2.33k stars 361 forks source link

Not able to generate confused file after implementing Confuser.MSBuild #494

Open divyeshneo opened 2 years ago

divyeshneo commented 2 years ago

Steps to Reproduce:

  1. We have added Confuser.MSBuild 1.6.0 via nuget package in our solution and added configuration settings in .CSProject as per given instruction in following URL :https://github.com/mkaring/ConfuserEx/wiki/MSBuild-Integration
  2. we have build the project and entire solution as well but we are not able to see the confuser .dll with in solution. Kindly help us to figure out the solution or let us know if we missed anything to add or check.
raburton commented 1 year ago

Are you getting any output at all? I found this issue when having the same problem, but mine had previously been working. It's not sufficient to add the values to the .csproj file, you also need to create a .crprog file, with the same name as your output file. E.g. for an output file of program.exe you need a program.crproj files as well. In my case, I had renamed my output file, so it was no longer matching the name of the .crproj file, and it was just copying the program to the confused folder, but not actually obfuscating it.

In .csproj I have

  <PropertyGroup>
    <Obfuscate>true</Obfuscate>
  </PropertyGroup>

In .crprog I have:

<project outputDir="$(OutDir)confused\" baseDir="$(MSBuildProjectDirectory)" xmlns="http://confuser.codeplex.com">
  <rule pattern="true" preset="normal" inherit="false" />
</project>
MichaelSvejcar commented 1 year ago

Hello, did you resolve this? I was trying the solution provided by @raburton, however, the output files are still not obfuscated. I have copied exactly the content of the .crprog file as you have mentioned. I have no idea what I might be missing.

Kravchenko32 commented 5 months ago

This really needs to get put into the docs: https://github.com/mkaring/ConfuserEx/wiki/MSBuild-Integration