我继承了一个 VB.Net 代码库,它是 VB 2005 并升级到 VB 2008,包含大约 100 个项目
我正在尝试重新版本所有组件,但发现某些 AssemblyInfo.vb 文件具有 AssemblyFileVersion
条目和一些有 AssemblyFileVersionAttribute
入口。
此外,有些人有 AssemblyVersion
条目和一些有 AssemblyVersionAttribute
入口。
有和没有有什么区别Attribute
?
我应该使用哪些?
最佳答案
没有区别。正如 int
将解析为 System.Int32
, 派生自 Attribute
的任何类型由编译器特别处理。所以...[MyCustom]
将解析为 [MyCustomAttribute]
Relavent MSDN Entry
By convention, all attribute names end with the word "Attribute" to distinguish them from other items in the .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.
关于VB.Net - AssemblyFileVersion & AssemblyFileVersionAttribute 和 AssemblyVersion & AssemblyVersionAttribute 之间有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3109848/