The StyleCopConsole.Core.Environment
expects that you've registered a parser for the file extension you're feeding to it. So you probably want to add a CsParser
instance to the Parsers collection and set the extension to .cs
.
Luckily the sources for StyleCop are available so it pays off to check why a code path might return false and see whether that precondition has been passed.