This project is read-only.

NuGet Package for creating custom rules

Apr 13, 2011 at 11:03 AM

Hi, created a NuGet package for those of us that like to create custom rules and extend stylecop (i.e. StyleCopCmd):

My package creation code is here:

I'd prefer if the NuGet package were managed under this project. If I were to fork StyleCop and contribute this, would it be accepted?


Apr 13, 2011 at 12:31 PM

Hi Damian,

Anything that enhances StyleCop I would consider merging back in - much like we've done with the StyleCop R# plugin recently.

Apr 17, 2011 at 2:41 PM

Good to hear :)

In my fork and pull request I've included a NuGet build step.


  1. StyleCop.nuspec file is Project\
  2. The package is outputted to Project\BuildDrop. You can change this path Tools\Scripts\CreateNuGetPackage.cmd
  3. You may wish to change contents of the authors element in the nuspec file.
  4. The version number is hard coded into the nuspec file. This can be overridden with a '-version' switch via CreateNuGetPackage.cmd. I'm not sure if you want this, or where I'd get the desired version number.
  5. Assumed that StyleCop.dll and StyleCop.CSharp.dll are just what is needed to create custom rules.
  6. You will need to add publishing the package to your coordinators workflow for building an official package.

If you accept this, and when you are ready, I will hand over the StyleCop project key on NuGet to you guys.

Any probs, let me know. I can be reached at\randompunter.

Apr 18, 2011 at 3:50 PM

Btw, this will help projects like StyleCop+ and Nerdbank easily keep up with StyleCop releases.

Jun 26, 2011 at 5:42 PM
Edited Jun 26, 2011 at 5:43 PM

There in an almost daily release of StyleCop at the moment and keeping the nuget package up-to-date is getting tedious.

I submitted a pull request a while ago to include creating the nuget package as part of the build process.

Any chance you can accept the request?

Also, pushing a new package to the NuGet gallery from build server is trivial - would this project's admins like to take ownership of the NuGet gallery item?

If there are any problems, please let me know.

Jun 26, 2011 at 6:09 PM
Edited Jun 26, 2011 at 7:39 PM
I'd forgotten.
I'll take another look this week.
Jun 28, 2011 at 11:32 AM

That would be great to get in before RTW. :)

Jun 29, 2011 at 5:58 PM

Hi Damien. NuGet build is done. I've added the package to the 4.5 downloads section for now. Can you update NuGet gallery please?

Jun 30, 2011 at 11:08 AM

Great. Am on the case.

Jun 30, 2011 at 11:21 AM
Edited Jun 30, 2011 at 11:27 AM


Andy, what is your username so I can add you as an additional maintainer (just in case)?

Also, am considering deleting the 4.5.*.0 packages upto the ..25 rtw release from Too soon?

Jun 30, 2011 at 11:48 AM

My nuget username is 'andyr'. I wouldn't delete the others yet.

Jun 30, 2011 at 12:46 PM

Added as owner.

Am happy to help out but feel free to remove me as owner if you deem it necessary / desirable.

Just one thing, you removed the StyleCop.CSharp.Rules.dll. I'd agree it's not required for creating custom rules. I was using for new version of StyleCopConsole that I'm in the process of ressurecting (a fork of StyleCopCmd).

Wondering if a StyleCop.CSharp.Rules package is overkill?

I'd prefer to use Nuget packages all they way if possible.

Jul 1, 2011 at 9:25 AM

Thanks. I didn't remove StyleCop.CSharp.Rules.dll - it just wasn't in the nuget file you submitted. I'll include it in the next update.

Jul 1, 2011 at 10:21 AM

Sorry, my bad :|