Can anyone recommend a way to block access to particular system classes in a particular assembly? For example I may want to block FileStream or other I/O classes in a class library that implements a certain layer that shouldn’t involve I/O. It doesn’t have to be insurmountable, the point isn’t to combat hostile developers, only to reduce layering errors by team members (including myself) and easily identify such code by breaking the compile.
Share
I don’t think you could ‘block access’. But you can analyze your codebase as part of the build. The only existing out-of-the-box solution I’m aware of is NDepend – it allows you to write explicit rules alike SQL. It is not free though.