Change assembly attribute values after the build in .Net

空扰寡人 提交于 2019-12-08 06:22:14

问题


I want to change the assembly attribute like AssemblyTitleAttribute value to something else once the build is done. Is this possible?

Its just that we have two types of builds one is base and the other is obfuscated, so we just want to add some changes to title / attribute values without rebiulding the assemblies.


回答1:


You could use ildasm to convert the assembly to IL, change the attribute value there and use ilasm to recreate the assembly. This may or may not be considered rebuilding.

However, it's likely just as easy and fast to conditionally compile the contents of the Assembly attributes in your project based on the top of the build. Developers are likely to be more familiar with this method and it's, IMHO, easier to maintain.



来源:https://stackoverflow.com/questions/2068167/change-assembly-attribute-values-after-the-build-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!