简体   繁体   English

VB.Net - AssemblyFileVersion和AssemblyFileVersionAttribute与AssemblyVersion和AssemblyVersionAttribute有什么区别

[英]VB.Net - What is the difference between AssemblyFileVersion & AssemblyFileVersionAttribute and AssemblyVersion & AssemblyVersionAttribute

I've inherited a VB.Net codebase which was VB 2005 and upgraded to VB 2008 consisting of around 100 projects 我继承了一个VB.Net代码库,它是VB 2005并升级到VB 2008,包含大约100个项目

I'm trying to re-version all of the components but have discovered some of the AssemblyInfo.vb files have an AssemblyFileVersion entry and some have an AssemblyFileVersionAttribute entry. 我正在尝试重新版本所有组件,但发现一些AssemblyInfo.vb文件有一个AssemblyFileVersion条目,有些具有AssemblyFileVersionAttribute条目。

Also, some have an AssemblyVersion entry and some have an AssemblyVersionAttribute entry. 此外,一些具有AssemblyVersion条目,一些具有AssemblyVersionAttribute条目。

What is the difference between with and without Attribute ? 有和没有Attribute什么区别?

Which ones should I be using? 我应该使用哪些?

There is no difference. 没有区别。 Just as int will resolve to System.Int32 , any type derived from Attribute is treated specially by the compiler. 就像int将解析为System.Int32 ,任何从Attribute派生的类型都由编译器专门处理。 So... 所以...

[MyCustom] will resolve to [MyCustomAttribute] [MyCustom]将解析为[MyCustomAttribute]

Relavent MSDN Entry 关联MSDN录入

By convention, all attribute names end with the word "Attribute" to distinguish them from other items in the .NET Framework. 按照惯例,所有属性名称都以单词“Attribute”结尾,以区别于.NET Framework中的其他项。 However, you do not need to specify the attribute suffix when using attributes in code. 但是,在代码中使用属性时,不需要指定属性后缀。 For example, [DllImport] is equivalent to [DllImportAttribute], but DllImportAttribute is the attribute's actual name in the .NET Framework. 例如,[DllImport]等同于[DllImportAttribute],但DllImportAttribute是.NET Framework中属性的实际名称。

AssemblyFileVersion and AssemblyFileVersionAttribute etc are the same thing and you can use either one. AssemblyFileVersionAssemblyFileVersionAttribute等是同一个东西,你可以使用其中任何一个。 Here 'sa response from Microsoft on their connect website about this. 以下是微软在其连接网站上对此的回应。

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

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