MSBuild MSBuildCommunityTasks 任务时间 [英] MSBuild MSBuildCommunityTasks Task Time

查看:20
本文介绍了MSBuild MSBuildCommunityTasks 任务时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 MSBuild 项目,我希望将当前日期添加到我正在创建的 zip 文件中.

I have a MSBuild project and I want the current date to be added to a zip file that I am creating.

我正在使用 MSBuildCommunityTasks.

I am using the MSBuildCommunityTasks.

<!-- Import the CommunityTasks Helpper -->
<Import Project="$(MSBuildExtensionsPath)MSBuildCommunityTasksMSBuild.Community.Tasks.Targets" />

在网站 http://msbuildtasks.tigris.org/ 我可以看到一个名为 time 的任务.我一直无法找到有关如何使用 Time 的文档.

On the website http://msbuildtasks.tigris.org/ I can see a task called time. I have not been able to find doc on how to use Time.

推荐答案

在 msbuild 4 中你现在可以

$([Namespace.Type]::Method(..parameters…))
$([Namespace.Type]::Property)
$([Namespace.Type]::set_Property(value))

所以我正在使用

$([System.DateTime]::Now.ToString(`yyyy.MMdd`))

格式周围的那些记号是反引号而不是 '

those ticks around the format are backticks not '

这篇关于MSBuild MSBuildCommunityTasks 任务时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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