Error after upgrading from 4.7.26 on tfs build server

Sep 17, 2012 at 12:12 PM

I seem to be getting the error pasted below after upgrading StyleCop.  The error only happens on the build server.  StyleCop is not installed on the build server but the binaries are in TFS. I manually point to this StyleCop directory in all of my csproj files. Does it need to be installed now rather than checked into TFS?  The error I'm getting is below:

 SA0001 : CoreParser : An exception occurred while parsing the file: System.ComponentModel.Win32Exception, %1 is not a valid Win32 application
    at StyleCop.Spelling.SpellChecker.Speller..ctor(String path)
    at StyleCop.Spelling.SpellChecker..ctor(CultureInfo culture, Language language)
    at StyleCop.Spelling.SpellChecker.FromCulture(CultureInfo culture)
    at StyleCop.Spelling.NamingService.GetNamingService(CultureInfo culture)
    at StyleCop.CSharp.CommentVerifier.TextContainsIncorectSpelling(CultureInfo culture, String text, String& spellingError)
    at StyleCop.CSharp.CommentVerifier.IsGarbageComment(String commentWithAttributesRemoved, String commentWithAttributesPreserved, CultureInfo culture, String& spellingError)
    at StyleCop.CSharp.DocumentationRules.CheckDocumentationValidity(CsElement element, Int32 lineNumber, XmlNode documentationXml, String documentationType)
    at StyleCop.CSharp.DocumentationRules.CheckHeaderSummary(CsElement element, Int32 lineNumber, Boolean partialElement, XmlDocument formattedDocs)
    at StyleCop.CSharp.DocumentationRules.ParseHeader(CsElement element, XmlHeader header, Int32 lineNumber, Boolean partialElement)
    at StyleCop.CSharp.DocumentationRules.CheckHeader(CsElement element, AnalyzerSettings settings, Boolean partialElement)
    at StyleCop.CSharp.DocumentationRules.CheckDocumentationForElement(CsElement element, CsElement parentElement, AnalyzerSettings settings)
    at StyleCop.CSharp.CodeWalker`1.WalkElement(CsElement element, CsElement parentElement, T context)
    at StyleCop.CSharp.CodeWalker`1.WalkElement(CsElement element, CsElement parentElement, T context)
    at StyleCop.CSharp.CodeWalker`1.WalkElement(CsElement element, CsElement parentElement, T context)
    at StyleCop.CSharp.CodeWalker`1.Start(CsDocument document, CodeWalkerElementVisitor`1 elementCallback, CodeWalkerStatementVisitor`1 statementCallback, CodeWalkerExpressionVisitor`1 expressionCallback, CodeWalkerQueryClauseVisitor`1 queryClauseCallback, T context)
    at StyleCop.CSharp.CsDocument.WalkDocument[T](CodeWalkerElementVisitor`1 elementCallback, CodeWalkerStatementVisitor`1 statementCallback, CodeWalkerExpressionVisitor`1 expressionCallback, CodeWalkerQueryClauseVisitor`1 queryClauseCallback, T context)
    at StyleCop.CSharp.CsDocument.WalkDocument[T](CodeWalkerElementVisitor`1 elementCallback, T context)
    at StyleCop.CSharp.DocumentationRules.CheckElementDocumentation(CsDocument document)
    at StyleCop.CSharp.DocumentationRules.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).

Sep 18, 2012 at 7:31 AM

I have the same problem. Reported it here http://stackoverflow.com/questions/12455878/stylecop-spelling-breaks-teamcity

Sep 19, 2012 at 5:10 AM

Hi,

This is definitely a 32bt/64bit issue. I have been trying to get this to run using tfspreview.com and encountered the same error message. After a few attempts I was able to get it working by re-configuring/building StyleCop to use the MSSP7EN.DLL and MSSP7EN.LEX which came with my Office 2010 64bit install. I suspect that TFS runs a 64bit version of MSBuild whereas locally Visual Studio only ever runs in 32bit.

For my local build of StyleCop I have changed the Language definition of "en-us" to (StyleCop/Spelling/SpellChecker.cs, Line 733)

new Language("en-us", IntPtr.Size == 4 ? "msspell3.dll" : "MSSP7EN.DLL", IntPtr.Size == 4 ? "mssp3en.lex" : "MSSP7EN.LEX", 1033)

This is of course only a work around, but it works locally and on the build server and might shed some light on a permanent fix.

Coordinator
Sep 19, 2012 at 11:54 AM

Updated to use mssp7en.dll by default (which works in 32 bit processes too) in next build 4.7.38. Thanks for your help everyone.

Sep 21, 2012 at 6:15 PM

Thanks for taking care of this Andy.  Much appreciated.

Sep 25, 2012 at 8:15 PM

so refreshing when every time i have a stylecop issue, andyr has already fixed it.  Thanks to you and the rest of the community for using this open source tool and keeping it fresh!

Coordinator
Sep 25, 2012 at 9:43 PM
Thanks. Your support means a lot. There's only me and a lot of bugs/features.

I'll do what I can.


~A.

On 25 Sep 2012, at 21:16, felickz <notifications@codeplex.com> wrote:

From: felickz

so refreshing when every time i have a stylecop issue, andyr has already fixed it. Thanks to you and the rest of the community for using this open source tool and keeping it fresh!

Apr 2 at 10:51 PM
Edited Apr 2 at 10:53 PM
I've don't know if this is related, but I pointed my build controller's custom assemblies path at a location in TFS, which included the StyleCopy assemblies.

I'm still encountering this when opening a build definition's process tab -- the associated build template does not contain any customization...
Warning: Could not load file or assembly 'file:///C:\Users\<userID>\AppData\Local\Temp\VSTFSBuild\07ff5f54-bc6e-4ad1-ab9f-7bfe97bbc99c\1537911253\mssp7en.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
Jun 2 at 11:43 AM
Hi all,

I believe the issue still present in the current build 4.7.49.0. The build controller is running VS 64bit, and the error message is the same as described earlier:
Summary: There were 0 failures, 0 errors and 1 warnings loading custom activities and services.
Warning: Could not load file or assembly 'file:///C:\Users\<user>\AppData\Local\Temp\VSTFSBuild\e0b9f924-828a-4760-90dd-ad9e111cc8d2\1104161178\mssp7en.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
All StyleCop binaries (the one from: C:\Program Files (x86)\StyleCop 4.7, except StyleCopSettingsEditor.exe) are located at TFS Controller's Assembly Location in TFS Version Control, together with other custom assemblies. I don't have any warning when Queue a build/Edit build definition before, until StyleCop was added.

(P/s: is there a 64bit build of StyleCop?)

Regards,
fabhar