Quantcast
Viewing all articles
Browse latest Browse all 106942

RSRP-125252: Analyze and fix: 'Replace + with Path.Combine'

Reporter Image may be NSFW.
Clik here to view.
Andrew Serebryansky (marcus23)
Andrew Serebryansky (marcus23)
Created Oct 15, 2009 1:54:21 PM
Updated Apr 11, 2018 5:52:16 PM
Resolved Apr 11, 2018 5:52:16 PM
Subsystem No Subsystem
Assignee Ilya Ryzhenkov (orangy)
Priority Normal
State Declined
Type Feature
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Replace "<folder> + <file>" with Path.Combine(<folder>, <file>). This solves the problem of the user mistakenly not checking whether <folder> ends with a folder separator, thereby creating path values like

"c:\windowsMyFile.txt" or
"c:\windows\\MyFile.txt"

Not sure if it's possible, but you could also check for the unwieldy logic people use when trying to manually handle the ending directory separator.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>