更改构建在.net组装后属性值 [英] Change assembly attribute values after the build in .Net

查看:133
本文介绍了更改构建在.net组装后属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变组件的属性就像AssemblyTitleAttribute值别的东西一旦构建完成。这可能吗?

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

它只是我们有两种类型的构建一种是基础,另一种是模糊的,所以我们只是想添加一些修改标题/属性值不rebiulding的组件。

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.

推荐答案

您可以使用ILDASM来装配转换为IL,改变属性值出现,并使用ILASM来重新组装。这可以或可以不被认为是重建

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.

这篇关于更改构建在.net组装后属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆