在运行时中获取Assembly.GetExecutingAssembly().lastwritetime?在Clickonce部署的程序中 [英] Get Assembly.GetExecutingAssembly().lastwritetime in Runtime? in Clickonce deployed program

查看:68
本文介绍了在运行时中获取Assembly.GetExecutingAssembly().lastwritetime?在Clickonce部署的程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我使用Clickonce发布了一个程序,我试图获取在我的计算机上VS2010中构建/发布.exe或.application的日期,以便客户端可以在他们在计算机上运行该应用程序.

但是似乎在运行时使用ApplicationDeployment类的发布版本信息正在运行,但是Assembly.GetExecutingAssembly()中的日期信息仅在调试时有效,而在运行时不起作用.

关于如何获取.exe/.application日期的任何建议?

还是仅使用上次写入文件的日期的变通办法?请启发我

Hi guys,i published a program using Clickonce, and I''m trying to get a date of when the .exe or .application is built/published in VS2010 on my computer, so that a client can see that date when they run the application on their computer.

But it seems during runtime the publish version info using the ApplicationDeployment class is working, but the date info from Assembly.GetExecutingAssembly() only works during debug, not in runtime.

Any suggestions how to get a date for the .exe/.application?

Or maybe a workaround of simply using the date of when the file was last written? please enlighten me

推荐答案

我在以下位置构建自己的时间戳: ^ ]
I build my own timestamp in: Timestamping assemblies with Build date and time.[^]


这篇关于在运行时中获取Assembly.GetExecutingAssembly().lastwritetime?在Clickonce部署的程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆