Following on from my previous question, what useful information can you retrieve from a .net assembly about the build process? I know I can look at the AssemblyVersion to get major and minor application version, and when the build took place.
继上一个问题之后,您可以从.net程序集中检索有关构建过程的有用信息吗?我知道我可以查看AssemblyVersion来获取主要和次要的应用程序版本,以及何时进行构建。
Can I find:
我可以找到:
- Who did the build? i.e. user name.
- On what machine?
- Which O/S version?
- Anything else useful?
谁做了这个版本?即用户名。
什么机器?
哪个O / S版本?
还有什么有用的吗?
2 个解决方案
#1
From my (limited) investigations (into assemblies I've built) you're basically limited to what the author put into the file.
从我的(有限的)调查(到我建立的集合),你基本上只限于作者放入文件。
About the only thing that's automatically assigned are the "Internal Name", "Original File name" and "Language".
关于自动分配的唯一内容是“内部名称”,“原始文件名”和“语言”。
There might be some IDE's that put in the information you require, but by default Visual Studio isn't one of them.
可能会有一些IDE放入您需要的信息,但默认情况下Visual Studio不是其中之一。
#2
By default, you don't have any of that information. Jon's answer to your previous question is actually the correct way to do this. You want to create custom attributes for each piece of information you want (or one attribute with properties for each) that apply to an assembly. This is how the attributes typically found in your AssemblyInfo file work.
默认情况下,您没有任何该信息。 Jon对您之前问题的回答实际上是正确的方法。您希望为应用于程序集的所需信息(或具有每个属性的一个属性)创建自定义属性。这是通常在AssemblyInfo文件中找到的属性的工作方式。
#1
From my (limited) investigations (into assemblies I've built) you're basically limited to what the author put into the file.
从我的(有限的)调查(到我建立的集合),你基本上只限于作者放入文件。
About the only thing that's automatically assigned are the "Internal Name", "Original File name" and "Language".
关于自动分配的唯一内容是“内部名称”,“原始文件名”和“语言”。
There might be some IDE's that put in the information you require, but by default Visual Studio isn't one of them.
可能会有一些IDE放入您需要的信息,但默认情况下Visual Studio不是其中之一。
#2
By default, you don't have any of that information. Jon's answer to your previous question is actually the correct way to do this. You want to create custom attributes for each piece of information you want (or one attribute with properties for each) that apply to an assembly. This is how the attributes typically found in your AssemblyInfo file work.
默认情况下,您没有任何该信息。 Jon对您之前问题的回答实际上是正确的方法。您希望为应用于程序集的所需信息(或具有每个属性的一个属性)创建自定义属性。这是通常在AssemblyInfo文件中找到的属性的工作方式。