在运行时更改 .Net 程序集名称 [英] Changing .Net assembly name at runtime

查看:41
本文介绍了在运行时更改 .Net 程序集名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用反射加载一个程序集并重命名它.当然,我不能只是重命名文件:我还必须更改其内部信息.

I need to load an assembly with reflection and rename it. Of course I cannot just rename the file: I must also change its internal information.

我该怎么做?

推荐答案

这不可能.Assembly 的名称一旦加载到 CLR 中就是不可变的.您需要在加载之前重命名它

This isn't possible. The name of an Assembly is immutable once loaded into the CLR. You would need to rename it before it was loaded

这篇关于在运行时更改 .Net 程序集名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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