在哪里可以找到程序集配置信息?
在 AssemblyInfo.cs 文件中,我有以下小节:
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
构建程序集后可以在哪里看到此信息?由于文件详细信息中没有任何内容:
还能在哪里找到它?
问候
in AssemblyInfo.cs file I have following subection:
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
Where this information can be seen after assembly is built ? Since there is nothing about it in file details:
where else can it be found ?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用反射来获取此信息。我相信它会像下面这样。
再想一想,这就是你的意图吗?
如何检查程序集是否是使用调试或发布配置构建的?
从顶部答案链接的博客文章显示了确定程序集是否可调试的更好方法:http://stevesmithblog.com/blog/define-whether-an- assembly-was-compiled-in-debug-mode/
一个答案表明,如果您使用 AssemblyDescription 属性有条件地在文本中包含发布/调试,则可以在 Windows 资源管理器中获取该信息。
You can use reflection to get this information. I believe it would be something like the following.
Thinking about it further is this your intent?
How to check if an assembly was built using Debug or Release configuration?
The blogpost linked from the top answer shows a better way to determine if the assembly is Debuggable: http://stevesmithblog.com/blog/determine-whether-an-assembly-was-compiled-in-debug-mode/
One answer indicates that if you use the AssemblyDescription attribute to conditionally include Release/Debug in the text you can have that information in Windows Explorer.
您可以使用ILDASM.exe来查看编译后的程序集。请参阅http://msdn.microsoft.com/en-us/library/ceats605。 aspx 了解有关使用 ILDASM.exe 的信息。
或者你可以使用Reflection通过代码来查看它,例如
System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes()
You can use ILDASM.exe to look at the compiled assembly. See http://msdn.microsoft.com/en-us/library/ceats605.aspx for info on using ILDASM.exe.
Or you may use Reflection to look at it via code, such as
System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes()
Windows 资源管理器属性表从 win32 VERSIONINFO 资源。许多程序集属性可以映射到 win32 资源字段 (并且将由构建设置)但
AssemblyConfiguration
属性可能不是其中之一。如果您想查看所有程序集属性,包括那些未设置 win32 资源字段的属性,请。 NET Reflector 是一种选择。
The Windows Explorer property sheet pulls that information from the win32 VERSIONINFO resources. A number of assembly attributes can be mapped to win32 resource fields (and will be set by the build) but it may be that the
AssemblyConfiguration
attribute is not one of them.If you want to look at all assembly attributes, including those that don't set win32 resource fields, .NET Reflector is one option.