Changing application name, icon and build information after compilation

I need to distribute software with two different names and, obviously, with other assembly information, such as name, descriptions, company, etc.

I am focused to find an easy way to deal with this huge problem, just by changing the compiled name / exe icon / etc.

Changing the icon is not a problem, I found an easy compilation of the message script. But I can not find an article about changing assembly information.

  • I tried with Mono.Cecil, but the resulting exe is always corrupt.
  • I tried to create a new wpf project extending the original App class, but it does not start due to lack of resources and other errors.
  • I read thousands of articles, but no one helped me.

Do you have any tips for me? or at least new ways to go?

+6
source share
1 answer

Try using AssemblyInfo.cs, for example, the following

#if XYZ [assembly: AssemblyTitle("NameXYZ")] #elif ABC [assembly: AssemblyTitle("NameABC")] #endif 

Then just create an application with two different configurations (ABC, XYZ).

As I understand it, assembly descriptors are part of the metadata that is written to the assembly at compile time and cannot be easily (maybe one way or another) changed subsequently to protect assembly consumers from someone who could mess with it.

+5
source

Source: https://habr.com/ru/post/980110/


All Articles