编译后更改Exe名称 [英] Changing Exe Name After Compilation

查看:69
本文介绍了编译后更改Exe名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在2.0或更低版本的.net框架下构建c#应用程序之后更改exe名称和程序集命名空间。

基本上我想要将exe名称放在配置文件下,每当我想更改exe名称和命名空间时,我只会在配置文件下进行更改。



如果有任何想法,请分享。







问候

Rohidas

Hi ,
I want to change the exe name and assembly namespace after Building the c# application under 2.0 or lower edition of .net framework.
basically i want to put exe name under config file and whenever i want to change exe name and namespace i will do only changes under config file .

any idea regarding this if please share it.



Regards
Rohidas

推荐答案

这个问题毫无意义。如果在config文件下表示名为myApplication.exe.config的文件,则它本身基于应用程序入口点程序集的主可执行模块的名称。这样,您将需要一些可以重命名文件的其他应用程序(甚至是批处理文件)。但为什么?我怀疑你的想法是否有意义,你应该更好地审查你的架构。



无论如何,请注意应用程序无法重命名。此外,没有代码可以重命名可执行文件(如果已加载)。至于命名空间,只需重新构建程序集就可以有效地更改它。



-SA
The question makes no sense at all. If, under "config" file you mean the file named as "myApplication.exe.config", it is itself based on the name of the main executable module of the entry-point assembly of your application. This way, you would need to have some other application (even the batch file) which could rename your file(s). But why? I doubt your idea can make any sense, you should better review your architecture.

Anyway, please be aware that the application cannot rename itself. Moreover, no code can rename an executable file, if it is loaded. As to the namespace, you can change it effectively only by re-building the assembly.

—SA

这篇关于编译后更改Exe名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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