使用AssemblyFileVersion作为名称将发布输出复制到新文件夹。 [英] Copy the release output to a new folder with the AssemblyFileVersion as the name.

查看:94
本文介绍了使用AssemblyFileVersion作为名称将发布输出复制到新文件夹。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

当我在RELEASE中生成我的程序版本时,我希望Visual Studio创建一个名为AssemblyFileVersion的新文件夹。



示例:

项目的输出为:C:\ Projects \ MyProgram \ bin \ Release

所需输出:E: \部署\ MyPram \ 2017.7.25.1700



我认为这是在Post-Build中完成的,但我不确定,我不知道如何要做什么?

$
还有其他解决方案吗?



提前谢谢。

Hello everyone.
When I generate a version of my program in RELEASE, I would like Visual Studio to create a new folder with the name AssemblyFileVersion.

Example:
The output of the project is: C: \ Projects \ MyProgram \ bin \ Release
Ouput desired: E: \ Deploy \ MyPram \ 2017.7.25.1700

I think this is done in Post-Build, but I'm not sure, and I do not know how to do it?

Is there another solution?

Thank you in advance.

推荐答案

嗨PRIOS - JF GODILLON,

Hi PRIOS - JF GODILLON,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

> ;>> 使用AssemblyFileVersion作为名称将发布输出复制到新文件夹。

>>>Copy the release output to a new folder with the AssemblyFileVersion as the name.

我们可以使用post-build来复制文件,但是如果你想要包含 AssemblyFileVersion
curre新文件夹名称中的数据,我们无法使用post-build来做到这一点。因为这两个属性不在
MSBuild 保留和众所周知的属性,我们无法使用它
在后期构建中。

We can use post-build to copy file, but if you want include the AssemblyFileVersion and current data in the new folder name, we could not use post-build to do that. Because those two properties are  not in the MSBuild Reserved and Well-Known Properties, we could not use it in the post-build directly.

但是我们可以在项目文件中添加目标以解决此问题:

But we could add a target in your project file to resolve this question:

  <PropertyGroup>
    <CurrentYear>


([System.DateTime] :: Now.Year)< / CurrentYear>
< CurrentMonth>
([System.DateTime]::Now.Year)</CurrentYear> <CurrentMonth>


([System.DateTime] :: Now.Month)< / CurrentMonth>
< CurrentDay>
([System.DateTime]::Now.Month)</CurrentMonth> <CurrentDay>


这篇关于使用AssemblyFileVersion作为名称将发布输出复制到新文件夹。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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