VS Post Build Event,复制解决方案文件夹上一层?
我目前
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)Shared.Lib\$(TargetFileName)"</PostBuildEvent>
</PropertyGroup>
想做这样的事情,但比 $(SolutionDir)
高一级
I currently have
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)Shared.Lib\$(TargetFileName)"</PostBuildEvent>
</PropertyGroup>
I want to do something like this, but one level above $(SolutionDir)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 ..\ 向上移动目录。
You can use ..\ to move up a directory.
解决方案:
如果引号内有
..\
,它会将其视为文字,而不是向上一级运行 DOS 命令。Solution:
If you have
..\
within the quotation marks, it will take it as literal instead of running the DOS command up one level.这在 VS2010 中不起作用..未解决,但成为
Studio 运行命令的路径的一部分,类似于复制驱动器$:\a\b\bin\debug 驱动器$:\a\b..\c
This is not working in VS2010 .. is not resolved but becomes part of the path
Studio is running command something like this copy drive$:\a\b\bin\debug drive$:\a\b..\c
在 .Net Core 中编辑 csproj 文件:
/Y
禁止提示您确认要覆盖现有目标文件。In .Net Core edit csproj file:
/Y
Suppresses prompting to confirm you want to overwrite an existing destination file.xcopy "$(TargerDir)." "$(SolutionDir)..\Installer\bin\"
注意:“../”用于上一级文件夹结构
xcopy "$(TargerDir)." "$(SolutionDir)..\Installer\bin\"
Note: "../" is used for One level up folder structure