I'm writing a Windows Phone framework with Windows 8 in mind. That means I'm creating a Portable Class Library (PCL) to be used in both platforms.
Right now my PCL is targeting .NET 4.5, Windows Phone 8 and Windows Store apps, as you can see in the project properties.
In that project I need to use Path.DirectorySeparatorChar
but I get the following error from the compiler:System.IO.Path' does not contain a definition for 'DirectorySeparatorChar'
I understand that that particular char might be different in the different targeted OS (I really don't know if they are) but why is the compiler complaining about it? I mean, the property help doc says it is supported by .net framework 4.5, am I targeting the right framework? Is the PCL really targeting the full .net framework 4.5?
Path.DirectorySeparatorChar
is not included in PCL,since it is available in all the platforms you are targeting, and severalPath
methods are PCL. But, what do you need the property for? Maybe you can circumvent it by usingPath.Combine(string[])
directly, which is available in PCL. – Anders Gustafsson