How can I remove tralling backslash from $(ProjectDir)?
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? Thangadurai 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