How can I remove tralling backslash from $(ProjectDir)?

本秂侑毒 提交于 2019-12-18 07:35:56

问题


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

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

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

How can I solve this?


回答1:


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

$(ProjectDir.TrimEnd('\'))

I found this option in this post



来源:https://stackoverflow.com/questions/36975106/how-can-i-remove-tralling-backslash-from-projectdir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!