Files - NKS0023
Use Filesystem.NeutralizePath()
This analyzer provides the following strings:
Context | String |
---|---|
Error List | Caller uses |
Suggestion Box | Use |
Description |
|
Extended Description
This code analyzer detects the usage of GetFullPath
from the standard Path
class found in the System.IO
namespace.
While Path.GetFullPath()
operates on the executable project directory, it doesn't represent the state of the current working directory because the UESH shell doesn't use the built-in current working directory property.
NeutralizePath()
had to be made to not only solve this problem, but also gives you a unified path that has folder names spearated by the platform-agnostic path separator.
Analysis Comparison
To get a brief insight about how this analyzer works, compare the two code blocks shown to you below:
Before the fix
After the fix
Suppression
You can suppress this suggestion by including it in the appropriate place, whichever is convenient.
For more information about how to suppress any warning issued by the Nitrocid analyzer, visit the below page:
Recommendation
We recommend that every caller which use this function use the recommended abovementioned method.
Last updated