Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9112995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:52:05+00:00 2026-06-17T03:52:05+00:00

I have a solution that contains twenty c# projects. Until recently, StyleCop would run

  • 0

I have a solution that contains twenty c# projects. Until recently, StyleCop would run against all files, except auto-generated files, across all projects and report any issues that it found. Recently (it’s not clear exactly when) it has become picky about which files it will report issues against.

Within a given project, I deliberately add the same defect to multiple source files and StyleCop will report the issue in some cases but not others.

An earlier branch of the same code, largely unaltered since October, does not display this behavior. Changing nothing but the source code I can demonstrate the problem existing in the latest code, but not in the code from October.

The skipped files do not contain any of the “I am auto-generated” markers that I would expect to cause StyleCop to skip them and I can find no commonality between either the skipped files or the analyzed files.

The solution file is unaltered between branches and the only changes to the csproj files are the addition/removal of source files.

Does anyone have any ideas what might be causing this behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:52:06+00:00Added an answer on June 17, 2026 at 3:52 am

    So, after significant chocolate consumption and much swearing, I have the answer:

    We recently inserted a copyright notice at the top of all our source files. It turns out that some of our source files had a byte order mark (U+FEFF) at the start of the file and the notice ended up being inserted ahead of this character.

    StyleCop takes offense to the presence of this character and silently ignores the rest of the file.

    Given that the character is, correctly, not rendered by the Visual Studio IDE, it took me three days to spot it 🙁

    EDIT (2013.01.14) : I’ve created a Perl script to remove BOMs from our source files:

    #!/usr/bin/perl -w
    use strict; 
    use warnings;
    use File::Find;
    
    my @dir = "C:/TopLevelSourceCodeDirectory";
    
    find(\&edits, @dir);
    
    sub edits() {
    
        my $file = $_;
    
        if( (-f $file) 
            && 
            (
                ($file =~ /.*\.cs$/)
                ||
                ($file =~ /.*\.xaml$/)
                ||
                ($file =~ /.*\.whatever$/)
            )
          ) {
    
            #Open the file and read in the data
            open (my $in, '<', $file) or die "Can't open $file: $!\n";
            my @lines = <$in>;
            close $in;
    
            #Open same file for writing
            open (my $out, '>', $file) or die "Can't open $file: $!\n";
    
            #Walk through lines, putting into $_, and remove BOMs
            for ( @lines ) {
                s/\xef\xbb\xbf//g;
                print $out $_;
            }
    
            close $out;
        }
    }
    

    One final note; I had all manor of issues writing this script because notepad seemed to add BOMs in the middle of my file (which are, of course, invisible) when I pasted certain character strings in (even though those strings didn’t originally contain a BOM). Working out why your regex doesn’t match when you can’t tell that it has an invisible BOM in the middle of the matcher string is not pleasant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Asp.Net solution that contains few WCF Service projects. Every time i run
I have a solution that contains a good deal of projects, I would like
I have a solution that contains several c# projects and I would like to
I have a Visual Studio 2010 solution that contains multiple projects. One of these
Suppose I have a solution inside a TFS collection that contains 3 projects. Ho
I have a solution that contains two projects. One project is an ASP.NET Web
I have a Visual Studio solution that contains two projects. One is a Windows
We have a solution that contains 17 projects. Solution has several configurations such as
I have a large solution that contains C# and C++ projects. After I code
I have a solution in VS2008 (C#) that contains multiple projects. I just retooled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.