This project is read-only.

File not being excluded during build

May 29, 2012 at 8:21 PM

I am building my project though TFS2010 and I have a reference.cs file that was created when I added a reference to a service. I have add the ExcludeFromStyleCop property to my project file to have it excluded, but from the build this does not seem to be happening. When I compile the project from the IDE (VS2010), the stylecop warnings do not show up.

I have just upgraded to Stylecop 4.7.27, but my problem is still occuring.

Any ideas on why the file is not being excluded on the build machine?




May 30, 2012 at 1:44 PM
Edited May 30, 2012 at 2:07 PM

After looking at this some more, it seems that these warnings do occur in the IDE but only when I build in release mode. They don't occur when building under debug. How can I get this file to be excluded when running in release mode?




May 30, 2012 at 1:55 PM

The only difference is normally the fact that any SuppressMessage attributes are removed when DEBUG is not defined.

May 30, 2012 at 2:09 PM

I don't have any SuppressMessage attributes in this file. It was generated by Visual Studio, so I don't want to have to go through it and make all of the stylecop changes. I just want this specific file to be excluded from analysis.

May 30, 2012 at 2:24 PM

Generated files can be defined in the Settings.StyleCop file so it'll automatically skip them. Anyway if you open a bug and attach a zip file of a solution/project that reproduces the problem I can fix it for you.

May 30, 2012 at 2:58 PM
Edited May 30, 2012 at 2:58 PM

I've tried to put together a simple project that will reproduce the same thing without any luck. Project builds just fine with only expected warnings in release mode. I've tried pointing my other project to the same stylecop files (settings and target) to make sure that wasn't the problem, but the warings are still occurring. Any ideas on my I would be seeing these errors only occur in open project?