This project is read-only.

Call to AddSourceFile() always returns false when not using VS2010 test-runner

Dec 16, 2013 at 8:30 AM
I found lots of examples for testing custom rules using MSTest and I got that one to work easily enough.

But these tests don't work when using the ReSharper testrunner. For some reason the call to
always returns false whenever I use something other than VS 2010's built-in testrunner via the Test View. As that Test View is possibly the least user-friendly tool I ever had to use for running tests I would prefer to use ReSharper. A lot.

I have a sub-folder inside my test assembly called Resources which contains the invalid source files for my tests and the Settings.StyleCop file. They are copied to the test output folder correctly (I added an extra check using File.Exists prior to calling AddSourceFile(...) to make sure of that).

I added references to StyleCop.dll, StyleCop.CSharp.dll and StyleCop.CSharp.Rules.dll which did not solve the problem.

Using the ReSharper runner the StyleCopCore.Parsers collection is always empty. When I use the VS runner it contains a CsParser.

Any ideas what I'm missing?