as fxcop is an assembly inspector, is it possible to create a custom rule that check if there s more than one class per file ?
If yes, how to do that ?
Thanks for your help
as fxcop is an assembly inspector, is it possible to create a custom rule that check if there s more than one class per file ?
If yes, how to do that ?
Thanks for your help
It is not possible to do that. Since FxCop only inspects binaries, it is impossible to tell which file a class was defined it.
However, look at StyleCop, which comes with such a rule out of the box. (SA1402: FileMayOnlyContainASingleClass)
As you say yourself: FxCop checks the compiled assemblies. Thus, there simply isn t something like a sourcecode file anymore. So the answer is no.
But MS StyleCop (quite similar to FxCop, but analyzing sourcecode files rather than IL code) might be able to do what you want. I don t know, if such a StyleCop rule already exists - if so, it s definitely not in the set of rules that come with StyleCop "out of the box" (i.e. the MS predefined ones...).
HTH!
EDIT: I ve seen at the moment, that there actually IS such a rule (see answer above)...
My thinking...
Sorry I don t know how to read info from the pdb file.
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...