How to debug StyleCop SDK errors

Jul 1, 2012 at 8:46 PM

I'm using the StyleCop SDK to programmatically run StyleCop.

I'm not getting back any violations, and I'd like to debug the issue. 

I tried downloading the StyleCop code and building it myself to get symbols for debugging, but that didn't work since my private build was not signed, and this leads to a StyleCop assertion thrown (StyleCop does an Assembly.GetName().GetPublicTokenKey(), and it comes back as null).

Jul 1, 2012 at 9:59 PM

Update : I was able to create debuggable bits by doing the following:

1) Download the stylecop source code

2) Right click on the projects (for StyleCop, StyleCop.CSharp, StyleCop.CSharp.Rules)-> properties -> Singing -> Add signing 

 

By doing this, I was able to see why StyleCop was failing - It was trying to load all assemblies from the "default path", and one of the assemblies failed to load, and caused StyleCop to break out of the "try to load rules" loop. I was able to solve this by isolating all my addin assemblies into one folder, and using the "addInPaths" parameter of the StyleCopConsole constructor to specify this dir.

 

Although this works, there should really be a better way to debug StyleCop issues. 

Aug 10, 2012 at 2:40 PM

Can you please guide me , from where u have downloaded the sour ce code.

I have downloaded the source code from source code tab , but all the files are downloaded with an extension .snippet and if i open them

they are opening in xml form..

CAn yoy please help me

 

Thanks,

Swapna

Coordinator
Aug 10, 2012 at 2:54 PM
In the documentation section are full instructions on how to set up your machine to build and develop the source code.


~A.

On 10 Aug 2012, at 14:40, swapna554 <notifications@codeplex.com> wrote:

From: swapna554

Can you please guide me , from where u have downloaded the sour ce code.

I have downloaded the source code from source code tab , but all the files are downloaded with an extension .snippet and if i open them

they are opening in xml form..

CAn yoy please help me

Thanks,

Swapna