Version information missing from .NET assembly (Compact Framework 3.5/VS2008)

﹥>﹥吖頭↗ 提交于 2019-12-23 17:53:10

问题


I am building an executable using VS2008 and .NET compact framework 3.5, targetting Windows Mobile 6 professional, but whenever I compile the project, everything that I have specified in the AssemblyInfo.cs file is ignored.

I have done this many times in other projects and it works without problem, but for some reason I cannot get the AssemblyTitle/AssemblyProduct/AssemblyVersion attributes etc to show up (I am trying to view them using Windows Explorer, I am able to see these properties in the details tab for any other assembly that I have built - even other projects in the same solution).

Any suggestions?


回答1:


That info is looking at the native version info, which on the desktop is set using the AssemblyFileVersionAttribute. The AssemblyFileVersionAttribute is unsupported in the CF, so the only way to set the version info out of the box is to command-line compile. There is a workaround in this blog.




回答2:


I know this is old, but there's a simpler solution posted here:
Version number in .NET Compact Framework application

You have to use reflection. System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision




回答3:


in tag PlatformFamilyName; rather that PocketPC, change to add WindowsCE in csproj



来源:https://stackoverflow.com/questions/1981297/version-information-missing-from-net-assembly-compact-framework-3-5-vs2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!