1
Vote

SA0001: An exception occurred while parsing the file: System.MissingMethodException, Method not found: 'Boolean StyleCop.CSharp.Field.get_Static()'.

description

After updating StyleCop from 4.7.16.0 to the current version 4.7.42.0, we get following exception on some classes, one of it is a Unit Test class.

How can we fix it?

Error 1 SA0001: An exception occurred while parsing the file: System.MissingMethodException, Method not found: 'Boolean StyleCop.CSharp.Field.get_Static()'.
at StyleCop.CSharp.NamingRules.CheckFieldPrefix(Field field, Dictionary2 validPrefixes)
at StyleCop.CSharp.NamingRules.ProcessElement(CsElement element, Dictionary
2 validPrefixes, Boolean nativeMethods)
at StyleCop.CSharp.NamingRules.ProcessElement(CsElement element, Dictionary2 validPrefixes, Boolean nativeMethods)
at StyleCop.CSharp.NamingRules.ProcessElement(CsElement element, Dictionary
2 validPrefixes, Boolean nativeMethods)
at StyleCop.CSharp.NamingRules.ProcessElement(CsElement element, Dictionary2 validPrefixes, Boolean nativeMethods)
at StyleCop.CSharp.NamingRules.AnalyzeDocument(CodeDocument document)
at StyleCop.StyleCopThread.RunAnalyzers(CodeDocument document, SourceParser parser, IEnumerable
1 analyzers)
at StyleCop.StyleCopThread.TestAndRunAnalyzers(CodeDocument document, SourceParser parser, IEnumerable`1 analyzers, Int32 passNumber)
at StyleCop.StyleCopThread.ParseAndAnalyzeDocument(SourceCode sourceCode, DocumentAnalysisStatus documentStatus)
at StyleCop.StyleCopThread.DoWork(Object sender).

file attachments

comments

knoxi wrote Dec 10, 2012 at 1:56 PM

Is there any news for this exception?
This exception appears every time when a field is in the class.

Because we changed to R# 7.1, this issue breaks up the using of StyleCop as Addin in R# and we cannot go back.

andyr wrote Dec 15, 2012 at 12:30 PM

Please attach a code sample that reproduces the problem and I'll fix it.

knoxi wrote Dec 17, 2012 at 8:56 AM

I have created a sample project which contains a sample class. If the private field in this class is commented out, StyleCop works correct, but if the field is active, StyleCop throws the exception above.

knoxi wrote Dec 17, 2012 at 9:00 AM

Also I have attached our rules.

knoxi wrote Jan 21, 2013 at 6:27 AM

We use primarely Windows 7 x64 as developer environment.

This error doesn't occurs on our x86 developer environment, but on all x64 environments.

Could this help to solve the exception? Because we would like to update to get the integration in R# again.

knoxi wrote Feb 20, 2013 at 7:23 AM

Any news here for this issue?