如何从$(ProjectDir)中删除斜线反斜杠? [英] How can I remove tralling backslash from $(ProjectDir)?

查看:172
本文介绍了如何从$(ProjectDir)中删除斜线反斜杠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建后的事件中我有这样的命令行:

I have a command line like this in my post-build event:

aspnet_regiis -pef connectionStrings "$(ProjectDir)" -prov "DataProtectionConfigurationProvider"

但是 aspnet_regiis 返回失败,因为目录中的 \ 。传递全名,path + web.config也不起作用。

But aspnet_regiis is returning a failure because the tralling \ in the directory. Pass full name, path + web.config doesn't work either.

我该如何解决?

推荐答案

您可以使用TrimEnd函数可修剪斜杠字符

You can use the TrimEnd function to trim the trailing slash character

$(ProjectDir.TrimEnd('\'))

我在此发布

这篇关于如何从$(ProjectDir)中删除斜线反斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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