.NET 程序集中缺少版本信息(Compact Framework 3.5/VS2008)

发布于 2024-08-16 22:43:00 字数 356 浏览 4 评论 0原文

我正在使用 VS2008 和 .NET 紧凑框架 3.5 构建一个可执行文件,目标是 Windows Mobile 6 professional,但是每当我编译该项目时,我在 AssemblyInfo.cs 文件中指定的所有内容都会被忽略。

我在其他项目中已经这样做了很多次,并且工作没有问题,但由于某种原因,我无法获取 AssemblyTitle/AssemblyProduct/AssemblyVersion 属性等显示(我尝试使用 Windows 资源管理器查看它们,我可以在我构建的任何其他程序集的详细信息选项卡中看到这些属性 - 甚至同一解决方案中的其他项目)。

有什么建议吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤蝉 2024-08-23 22:43:00

该信息查看本机版本信息,该信息在桌面上使用 AssemblyFileVersionAttribute 设置。 CF 中不支持 AssemblyFileVersionAttribute,因此开箱即用地设置版本信息的唯一方法是命令行编译。有 此博客中的解决方法

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.

野却迷人 2024-08-23 22:43:00

我知道这已经过时了,但这里发布了一个更简单的解决方案:
.NET Compact Framework 应用程序中的版本号

您必须使用反射。
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor System.Reflection.Assembly.GetExecutingAssembly().GetName().Version。构建 System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision

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

若水般的淡然安静女子 2024-08-23 22:43:00

在标签 PlatformFamilyName 中;而不是PocketPC,改为添加WindowsCE
在 csproj 中

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文