简体   繁体   English

如何在Visual Studio中更改程序集名称?

[英]How to change assembly name in Visual Studio?

I need to rename assembly name of DLL, after every compile, by adds increment to base name. 我需要在每次编译后通过将增量添加到基本名称来重命名DLL的​​程序集名称。 For example 例如

1 compile: Assembly name - basename1.dll
2 compile: Assembly name - basename2.dll
n compile: Assembly name - basenamen.dll

I cant just rename a file, because dll contains some meta information about its name. 我不能只重命名文件,因为dll包含一些有关其名称的元信息。 How can i do it automatically after every recompile? 每次重新编译后如何自动执行?

I use Visual studio 2013,c# 我使用Visual Studio 2013,c#

You can add a post build step in your project properties, something like this: 您可以在项目属性中添加一个后构建步骤,如下所示:

rename "$(TargetPath)" "newname.dll"

If you want to add more specific information about the file, then you can create a powershell script that reads the AssemblyInfo and adds that to the file name 如果要添加有关文件的更多特定信息,则可以创建一个powershell脚本来读取AssemblyInfo并将其添加到文件名中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM