ArchRoslyn.Analyzers 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ArchRoslyn.Analyzers --version 0.1.1
NuGet\Install-Package ArchRoslyn.Analyzers -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ArchRoslyn.Analyzers" Version="0.1.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArchRoslyn.Analyzers --version 0.1.1
#r "nuget: ArchRoslyn.Analyzers, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ArchRoslyn.Analyzers as a Cake Addin
#addin nuget:?package=ArchRoslyn.Analyzers&version=0.1.1

// Install ArchRoslyn.Analyzers as a Cake Tool
#tool nuget:?package=ArchRoslyn.Analyzers&version=0.1.1

Nuget codecov

Roslyn Architecture Analyzer

The ultimate goal of this project is to augment Roslyn C# compiler with additional architecture-related rules. Unlike the more common unit-test based approach, I envision this analyzers to be a part of the main compilation process, with near-instant feedback for developer. These rules should be:

  • Fast
  • Portable
  • Configurable by the end-user

Right now project consists of only one simple analyzer, inspired by an InternalsVisibleTo attribute. If you need more advanced capabilities, you should check out ArchUnitNET or NetArchTest.

CannotBeReferencedBy attribute

This is an assembly attribute that takes one string argument with a name of an assembly and forbids direct and transitive references from the specified assembly to the assembly marked with this attribute. Basically, this attribute is an antipode of InternalsVisibleTo attribute.

Usage instructions

Install ArchRoslyn.Abstractions package in order to mark assemblies with this attribute. Install ArchRoslyn.Analyzer into your projects to enable validation of rules imposed by an attribute.

List of ideas

  • Explore unit-testing lib APIs for inspiration and possible adoption as an interface for Roslyn-based rules.
  • How to expand CannotBeReferencedBy attributes to allow more generic configuration? - e.g. layers, folders, wildcards, etc.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.4.0 446 6/28/2022
0.2.3 390 6/22/2022
0.2.2 376 6/22/2022
0.2.1 371 6/19/2022
0.2.0 418 6/19/2022
0.1.1 415 6/14/2022